reduce max tokenize cache size

This commit is contained in:
sub-hub
2025-04-03 12:17:01 +09:00
committed by GitHub
parent 99efcc5f23
commit a32e670108

View File

@@ -11,7 +11,7 @@ import { pluginV2 } from "./plugins/plugins";
import type { GemmaTokenizer } from "@huggingface/transformers"; import type { GemmaTokenizer } from "@huggingface/transformers";
import { LRUMap } from 'mnemonist'; import { LRUMap } from 'mnemonist';
const MAX_CACHE_SIZE = 3000; const MAX_CACHE_SIZE = 1500;
const encodeCache = new LRUMap<string, number[] | Uint32Array | Int32Array>(MAX_CACHE_SIZE); const encodeCache = new LRUMap<string, number[] | Uint32Array | Int32Array>(MAX_CACHE_SIZE);