fix: filter out variant engine (#4639)
* fix: filter out variant engine * fix: filter out startwith
This commit is contained in:
parent
89fc777f0d
commit
6d73f49cdf
@ -265,92 +265,98 @@ const LocalEngineSettings = ({ engine }: { engine: InferenceEngine }) => {
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
{releasedEnginesByVersion &&
|
{releasedEnginesByVersion &&
|
||||||
releasedEnginesByVersion?.map((item, i) => {
|
releasedEnginesByVersion
|
||||||
return (
|
?.filter((item) => {
|
||||||
<div
|
return !item.name.startsWith('cuda-')
|
||||||
key={i}
|
})
|
||||||
className={twMerge(
|
.map((item, i) => {
|
||||||
'border border-b-0 border-[hsla(var(--app-border))] bg-[hsla(var(--tertiary-bg))] p-4 first:rounded-t-lg last:rounded-b-lg last:border-b',
|
return (
|
||||||
releasedEnginesByVersion?.length === 1 && 'rounded-lg'
|
<div
|
||||||
)}
|
key={i}
|
||||||
>
|
className={twMerge(
|
||||||
<div className="flex flex-col items-start justify-start gap-4 sm:flex-row sm:items-center sm:justify-between">
|
'border border-b-0 border-[hsla(var(--app-border))] bg-[hsla(var(--tertiary-bg))] p-4 first:rounded-t-lg last:rounded-b-lg last:border-b',
|
||||||
<div className="flex w-full gap-x-8">
|
releasedEnginesByVersion?.length === 1 &&
|
||||||
<div className="flex h-full w-full items-center justify-between gap-2">
|
'rounded-lg'
|
||||||
<h6
|
)}
|
||||||
className={twMerge(
|
>
|
||||||
'font-medium lg:line-clamp-1 lg:min-w-[280px] lg:max-w-[280px]',
|
<div className="flex flex-col items-start justify-start gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||||
'max-w-none text-[hsla(var(--text-secondary))]'
|
<div className="flex w-full gap-x-8">
|
||||||
)}
|
<div className="flex h-full w-full items-center justify-between gap-2">
|
||||||
>
|
<h6
|
||||||
{item.name}
|
className={twMerge(
|
||||||
</h6>
|
'font-medium lg:line-clamp-1 lg:min-w-[280px] lg:max-w-[280px]',
|
||||||
|
'max-w-none text-[hsla(var(--text-secondary))]'
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{item.name}
|
||||||
|
</h6>
|
||||||
|
|
||||||
{installedEngineByVersion?.some(
|
{installedEngineByVersion?.some(
|
||||||
(x) => x.name === item.name
|
(x) => x.name === item.name
|
||||||
) ? (
|
) ? (
|
||||||
<DeleteEngineVariant
|
<DeleteEngineVariant
|
||||||
variant={item}
|
variant={item}
|
||||||
engine={engine}
|
engine={engine}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{installingEngines.has(item.name) ? (
|
{installingEngines.has(item.name) ? (
|
||||||
<Button variant="soft">
|
<Button variant="soft">
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<Progress
|
<Progress
|
||||||
className="inline-block h-2 w-[80px]"
|
className="inline-block h-2 w-[80px]"
|
||||||
value={
|
value={
|
||||||
formatDownloadPercentage(
|
formatDownloadPercentage(
|
||||||
|
installingEngines.get(
|
||||||
|
item.name
|
||||||
|
) ?? 0,
|
||||||
|
{
|
||||||
|
hidePercentage: true,
|
||||||
|
}
|
||||||
|
) as number
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<span className="tabular-nums">
|
||||||
|
{formatDownloadPercentage(
|
||||||
installingEngines.get(
|
installingEngines.get(
|
||||||
item.name
|
item.name
|
||||||
) ?? 0,
|
) ?? 0
|
||||||
{
|
)}
|
||||||
hidePercentage: true,
|
</span>
|
||||||
}
|
</div>
|
||||||
) as number
|
</Button>
|
||||||
}
|
) : (
|
||||||
/>
|
<Button
|
||||||
<span className="tabular-nums">
|
variant="soft"
|
||||||
{formatDownloadPercentage(
|
onClick={() => {
|
||||||
installingEngines.get(item.name) ??
|
setInstallingEngines((prev) => {
|
||||||
0
|
const updated = new Map(prev)
|
||||||
)}
|
updated.set(item.name, 0)
|
||||||
</span>
|
return updated
|
||||||
</div>
|
})
|
||||||
</Button>
|
installEngine(engine, {
|
||||||
) : (
|
variant: item.name,
|
||||||
<Button
|
version: String(
|
||||||
variant="soft"
|
defaultEngineVariant?.version
|
||||||
onClick={() => {
|
),
|
||||||
setInstallingEngines((prev) => {
|
}).then(() => {
|
||||||
const updated = new Map(prev)
|
if (selectedVariants === '') {
|
||||||
updated.set(item.name, 0)
|
setSelectedVariants(item.name)
|
||||||
return updated
|
}
|
||||||
})
|
})
|
||||||
installEngine(engine, {
|
}}
|
||||||
variant: item.name,
|
>
|
||||||
version: String(
|
Download
|
||||||
defaultEngineVariant?.version
|
</Button>
|
||||||
),
|
)}
|
||||||
}).then(() => {
|
</>
|
||||||
if (selectedVariants === '') {
|
)}
|
||||||
setSelectedVariants(item.name)
|
</div>
|
||||||
}
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Download
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)
|
||||||
)
|
})}
|
||||||
})}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user