Skip to content

Commit

Permalink
Tiktoken: in the future, show tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed May 16, 2024
1 parent 21d045b commit d5c3f50
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/common/util/token-counter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 6,9 @@ import { DLLMId, findLLMOrThrow } from '~/modules/llms/store-llms';
// Do not set this to true in production, it's very verbose
const DEBUG_TOKEN_COUNT = false;

// Globals
// const tokenEncodings: string[] = ['gpt2', 'r50k_base', 'p50k_base', 'p50k_edit', 'cl100k_base', 'o200k_base'] satisfies TiktokenEncoding[];

// Global symbols to dynamically load the Tiktoken library
let get_encoding: ((encoding: TiktokenEncoding) => Tiktoken) | null = null;
let encoding_for_model: ((model: TiktokenModel) => Tiktoken) | null = null;
Expand Down

0 comments on commit d5c3f50

Please sign in to comment.