fixing sesame model
This commit is contained in:
parent
5d1a162ddd
commit
4faa6e9152
3 changed files with 8 additions and 5 deletions
|
|
@ -268,11 +268,12 @@ async def list_models(
|
|||
@router.get("/config/{model_name:path}")
|
||||
async def get_model_config(
|
||||
model_name: str,
|
||||
hf_token: Optional[str] = Query(None),
|
||||
current_subject: str = Depends(get_current_subject),
|
||||
):
|
||||
"""
|
||||
Get configuration for a specific model.
|
||||
|
||||
|
||||
This endpoint wraps the backend load_model_defaults function.
|
||||
"""
|
||||
try:
|
||||
|
|
@ -281,9 +282,9 @@ async def get_model_config(
|
|||
# Load model defaults from backend
|
||||
config_dict = load_model_defaults(model_name)
|
||||
|
||||
# Detect model capabilities
|
||||
# Detect model capabilities (pass HF token for gated models)
|
||||
is_vision = is_vision_model(model_name)
|
||||
audio_type = detect_audio_type(model_name)
|
||||
audio_type = detect_audio_type(model_name, hf_token=hf_token)
|
||||
|
||||
# Check if it's a LoRA adapter
|
||||
is_lora = False
|
||||
|
|
|
|||
|
|
@ -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