fixing sesame model

This commit is contained in:
Manan17 2026-03-07 18:59:19 +00:00
commit 4faa6e9152
3 changed files with 8 additions and 5 deletions

View file

@ -94,9 +94,11 @@ export async function checkVisionModel(modelName: string): Promise<boolean> {
export async function getModelConfig(
modelName: string,
signal?: AbortSignal,
hfToken?: string,
): Promise<ModelConfigResponse> {
const encoded = encodeURIComponent(modelName);
const response = await authFetch(`/api/models/config/${encoded}`, { signal });
const params = hfToken ? `?hf_token=${encodeURIComponent(hfToken)}` : "";
const response = await authFetch(`/api/models/config/${encoded}${params}`, { signal });
if (!response.ok) {
throw new Error(`Failed to fetch model config (${response.status})`);
}

View file

@ -110,7 +110,7 @@ export const useTrainingConfigStore = create<TrainingConfigStore>()(
modelDefaultsError: null,
});
void getModelConfig(modelName, controller.signal)
void getModelConfig(modelName, controller.signal, get().hfToken || undefined)
.then((modelDetails) => {
if (controller.signal.aborted) return;
if (get().selectedModel !== modelName) return;