mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-16 14:03:43 +08:00
optimize mask
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import bcrypt from "bcryptjs";
|
||||
import {get_encoding} from "tiktoken";
|
||||
import { get_encoding } from "tiktoken";
|
||||
|
||||
|
||||
export function getTokenLength(input: string): number {
|
||||
const encoding = get_encoding("cl100k_base");
|
||||
// console.log('tokens: ', input, encoding.countTokens())
|
||||
return encoding.encode(input).length;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user