Skip to content

Commit 53bd5ae

Browse files
committed
feat: fix tokenizer test
1 parent 61a5a95 commit 53bd5ae

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/tokenizer.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
import { AllModels, ModelInfoMap, getModelInfoWithId, ModelEnum } from '../src';
1+
import { ModelInfoMap, getModelInfoWithId, ModelEnum, ModelLike } from '../src';
22
import { AutoTokenizer } from '@xenova/transformers';
33

44
describe('llm', () => {
55
it('tokenizer works', async () => {
66
const testSentence =
77
"Many words map to one token, but some don't: indivisible.";
88
const results: string[] = [];
9-
for (let i = 0; i < AllModels.length; i++) {
10-
const model = AllModels[i];
9+
10+
// Test only a few specific models instead of all models
11+
const modelsToTest: ModelLike[] = [
12+
ModelEnum['gpt-4o'],
13+
ModelEnum['claude-3-5-sonnet-20241022'],
14+
ModelEnum['o4-mini'],
15+
ModelEnum['gemini-2.5-pro-preview-03-25'],
16+
];
17+
18+
for (const model of modelsToTest) {
1119
if (ModelInfoMap[model].tokenizerId) {
1220
const tokenizer = await AutoTokenizer.from_pretrained(
1321
ModelInfoMap[model].tokenizerId

0 commit comments

Comments
 (0)