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);
|
||||
searchTerm = '';
|
||||
|
||||
try {
|
||||
await modelsStore.switchBackend();
|
||||
} catch (error) {
|
||||
console.error('Failed to switch backend:', error);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSelect(modelId: string) {
|
||||
|
||||
@@ -169,11 +169,15 @@ class ModelsStore implements ModelPropsHost, ModelStatusHost {
|
||||
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 favoriteOption = favorite
|
||||
? availableModels.find((m) => m.id === favorite || m.model === favorite)
|
||||
: undefined;
|
||||
|
||||
if (favorite) {
|
||||
await this.selectModelById(favorite);
|
||||
if (favoriteOption) {
|
||||
await this.selectModelById(favoriteOption.id);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user