feat: 增加通义千问支持

This commit is contained in:
ikechan8370 2023-10-25 21:50:44 +08:00
parent d528840297
commit c0936e6e2a
13 changed files with 1380 additions and 72 deletions

View file

@ -0,0 +1,6 @@
import { getEncoding } from 'js-tiktoken';
// TODO: make this configurable
var tokenizer = getEncoding('cl100k_base');
export function encode(input) {
return new Uint32Array(tokenizer.encode(input));
}