mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-17 20:31:47 +02:00
ui : ignore favorites that belong to another backend
Assisted-by: pi:llama.cpp/DeepSeek-V4.1-Flash
This commit is contained in:
@@ -129,7 +129,11 @@ export function useModelsSelector(opts: UseModelsSelectorOptions): UseModelsSele
|
|||||||
backendsStore.setActive(backendId);
|
backendsStore.setActive(backendId);
|
||||||
searchTerm = '';
|
searchTerm = '';
|
||||||
|
|
||||||
await modelsStore.switchBackend();
|
try {
|
||||||
|
await modelsStore.switchBackend();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Failed to switch backend:', error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleSelect(modelId: string) {
|
async function handleSelect(modelId: string) {
|
||||||
|
|||||||
@@ -169,11 +169,15 @@ class ModelsStore implements ModelPropsHost, ModelStatusHost {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try loading a favorite model
|
// Try a favorite model, but only one that exists on this backend: favorites
|
||||||
|
// are shared across backends, so a stored id may belong to another one
|
||||||
const favorite = this.favoriteModelIds.values().next()?.value;
|
const favorite = this.favoriteModelIds.values().next()?.value;
|
||||||
|
const favoriteOption = favorite
|
||||||
|
? availableModels.find((m) => m.id === favorite || m.model === favorite)
|
||||||
|
: undefined;
|
||||||
|
|
||||||
if (favorite) {
|
if (favoriteOption) {
|
||||||
await this.selectModelById(favorite);
|
await this.selectModelById(favoriteOption.id);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user