fix: should normalize model ID from source instead of frontend
This commit is contained in:
parent
526e532e2d
commit
8c28f9b6a6
@ -139,7 +139,7 @@ function Hub() {
|
|||||||
filtered = filtered?.filter((model) =>
|
filtered = filtered?.filter((model) =>
|
||||||
model.quants.some((variant) =>
|
model.quants.some((variant) =>
|
||||||
llamaProvider?.models.some(
|
llamaProvider?.models.some(
|
||||||
(m: { id: string }) => m.id === sanitizeModelId(variant.model_id)
|
(m: { id: string }) => m.id === variant.model_id
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -677,8 +677,8 @@ function Hub() {
|
|||||||
{filteredModels[virtualItem.index].quants.map(
|
{filteredModels[virtualItem.index].quants.map(
|
||||||
(variant) => (
|
(variant) => (
|
||||||
<CardItem
|
<CardItem
|
||||||
key={sanitizeModelId(variant.model_id)}
|
key={variant.model_id}
|
||||||
title={sanitizeModelId(variant.model_id)}
|
title={variant.model_id}
|
||||||
actions={
|
actions={
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<p className="text-main-view-fg/70 font-medium text-xs">
|
<p className="text-main-view-fg/70 font-medium text-xs">
|
||||||
@ -687,32 +687,19 @@ function Hub() {
|
|||||||
{(() => {
|
{(() => {
|
||||||
const isDownloading =
|
const isDownloading =
|
||||||
localDownloadingModels.has(
|
localDownloadingModels.has(
|
||||||
sanitizeModelId(
|
|
||||||
variant.model_id
|
variant.model_id
|
||||||
)
|
|
||||||
) ||
|
) ||
|
||||||
downloadProcesses.some(
|
downloadProcesses.some(
|
||||||
(e) =>
|
(e) => e.id === variant.model_id
|
||||||
e.id ===
|
|
||||||
sanitizeModelId(
|
|
||||||
variant.model_id
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
const downloadProgress =
|
const downloadProgress =
|
||||||
downloadProcesses.find(
|
downloadProcesses.find(
|
||||||
(e) =>
|
(e) => e.id === variant.model_id
|
||||||
e.id ===
|
|
||||||
sanitizeModelId(
|
|
||||||
variant.model_id
|
|
||||||
)
|
|
||||||
)?.progress || 0
|
)?.progress || 0
|
||||||
const isDownloaded =
|
const isDownloaded =
|
||||||
llamaProvider?.models.some(
|
llamaProvider?.models.some(
|
||||||
(m: { id: string }) =>
|
(m: { id: string }) =>
|
||||||
m.id ===
|
m.id === variant.model_id
|
||||||
sanitizeModelId(
|
|
||||||
variant.model_id
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (isDownloading) {
|
if (isDownloading) {
|
||||||
@ -746,10 +733,8 @@ function Hub() {
|
|||||||
size="sm"
|
size="sm"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
handleUseModel(
|
handleUseModel(
|
||||||
sanitizeModelId(
|
|
||||||
variant.model_id
|
variant.model_id
|
||||||
)
|
)
|
||||||
)
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{t('hub:use')}
|
{t('hub:use')}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user