mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 22:07:10 +00:00
feat: 增加通义千问支持
This commit is contained in:
parent
d528840297
commit
c0936e6e2a
13 changed files with 1380 additions and 72 deletions
6
utils/alibaba/tokenizer.js
Normal file
6
utils/alibaba/tokenizer.js
Normal 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));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue