mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +00:00
feat: 增加通义千问支持
This commit is contained in:
parent
d528840297
commit
c0936e6e2a
13 changed files with 1380 additions and 72 deletions
8
utils/alibaba/tokenizer.ts
Normal file
8
utils/alibaba/tokenizer.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { getEncoding } from 'js-tiktoken'
|
||||
|
||||
// TODO: make this configurable
|
||||
const tokenizer = getEncoding('cl100k_base')
|
||||
|
||||
export function encode(input: string): Uint32Array {
|
||||
return new Uint32Array(tokenizer.encode(input))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue