fixing sesame model
This commit is contained in:
parent
5d1a162ddd
commit
4faa6e9152
3 changed files with 8 additions and 5 deletions
|
|
@ -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})`);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue