feat(frontend): auto-detect vision models via backend, separate search filter from model classification
This commit is contained in:
parent
43d84d7143
commit
09f3b6bce5
7 changed files with 68 additions and 7 deletions
21
studio/frontend/src/features/training/api/models-api.ts
Normal file
21
studio/frontend/src/features/training/api/models-api.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { authFetch } from "@/features/auth";
|
||||
|
||||
interface VisionCheckResponse {
|
||||
model_name: string;
|
||||
is_vision: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a model is a vision model by asking the backend.
|
||||
* Calls GET /api/models/check-vision/{model_name}.
|
||||
*/
|
||||
export async function checkVisionModel(modelName: string): Promise<boolean> {
|
||||
const encoded = encodeURIComponent(modelName);
|
||||
const response = await authFetch(`/api/models/check-vision/${encoded}`);
|
||||
if (!response.ok) {
|
||||
// If the check fails (e.g. network error), default to non-vision
|
||||
return false;
|
||||
}
|
||||
const data = (await response.json()) as VisionCheckResponse;
|
||||
return data.is_vision;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue