mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
fix: models not loading
Co-Authored-By: _00_ <131402327+rgaricano@users.noreply.github.com>
This commit is contained in:
parent
1a15a62b73
commit
bbfe456f90
3 changed files with 3 additions and 3 deletions
|
|
@ -234,7 +234,7 @@ export const getOllamaModels = async (token: string = '', urlIdx: null | number
|
|||
return (res?.models ?? [])
|
||||
.map((model) => ({ id: model.model, name: model.name ?? model.model, ...model }))
|
||||
.sort((a, b) => {
|
||||
return a.name.localeCompare(b.name);
|
||||
return (a?.name ?? a?.id ?? '').localeCompare(b?.name ?? b?.id ?? '');
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@
|
|||
if (a.rating === '-' && b.rating !== '-') return 1;
|
||||
if (b.rating === '-' && a.rating !== '-') return -1;
|
||||
if (a.rating !== '-' && b.rating !== '-') return b.rating - a.rating;
|
||||
return a.name.localeCompare(b.name);
|
||||
return (a?.name ?? a?.id ?? '').localeCompare(b?.name ?? b?.id ?? '');
|
||||
});
|
||||
|
||||
loadingLeaderboard = false;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
// return (b.is_active ?? true) - (a.is_active ?? true);
|
||||
// }
|
||||
// If both models' active states are the same, sort alphabetically
|
||||
return a.name.localeCompare(b.name);
|
||||
return (a?.name ?? a?.id ?? '').localeCompare(b?.name ?? b?.id ?? '');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue