fix: 2.7 dev start

This commit is contained in:
ikechan8370 2023-06-22 18:30:08 +08:00
parent fbe8953667
commit 4a4dceec18
7 changed files with 5459 additions and 6 deletions

View 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))
}