Spaces:
Runtime error
Runtime error
fetch all tokenizer configs
Browse files12 unmodified lines1314151617181920212 unmodified lines24252627282912 unmodified linesAuthorization: `Bearer ${HF_TOKEN}`}});let compatibleModels: ModelEntry[] = await res.json();compatibleModels.sort((a, b) => a.id.toLowerCase().localeCompare(b.id.toLowerCase()));compatibleModels = compatibleModels.slice(0, 2);const promises = compatibleModels.map(async (model) => {const configUrl = `https://huggingface.co/${model.modelId}/raw/main/tokenizer_config.json`;2 unmodified linesAuthorization: `Bearer ${HF_TOKEN}`}});const tokenizerConfig = await res.json();return { ...model, tokenizerConfig } satisfies ModelEntryWithTokenizer;});12 unmodified lines13141516171819202 unmodified lines232425262728293031323312 unmodified linesAuthorization: `Bearer ${HF_TOKEN}`}});const compatibleModels: ModelEntry[] = await res.json();compatibleModels.sort((a, b) => a.id.toLowerCase().localeCompare(b.id.toLowerCase()));const promises = compatibleModels.map(async (model) => {const configUrl = `https://huggingface.co/${model.modelId}/raw/main/tokenizer_config.json`;2 unmodified linesAuthorization: `Bearer ${HF_TOKEN}`}});if (!res.ok) {throw new Error(`Failed to fetch tokenizer configuration for model ${model.id}: ${res.status} ${res.statusText}`);}const tokenizerConfig = await res.json();return { ...model, tokenizerConfig } satisfies ModelEntryWithTokenizer;});
src/routes/+page.server.ts+6-2