mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-30 01:47:39 -05:00
ui : fix badge guard for draft sidecars, keep parameter precision
hasBadges now counts draft sidecar badges, so a sidecar-only model still renders. Billions keep one decimal for hub counts and stay bare for whole values. Avatar failures track the org instead of the instance, and the download progress bar no longer pulses while determinate. Assisted-by: pi:zai-org/GLM-5.3-Flash
This commit is contained in:
@@ -95,6 +95,7 @@
|
||||
|
||||
let hasBadges = $derived(
|
||||
parsed.sidecar ||
|
||||
uniqueDraftSidecars.length > 0 ||
|
||||
(parsed.params && !hideParameters) ||
|
||||
(parsed.quantization && !resolvedHideQuantization) ||
|
||||
primaryAlias ||
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
{#if overlay}
|
||||
<div class="pointer-events-none absolute inset-x-0 bottom-0 h-0.5 overflow-hidden rounded-b-sm">
|
||||
<div
|
||||
class="h-full animate-pulse bg-primary transition-[width] duration-200 ease-out"
|
||||
class="h-full bg-primary transition-[width] duration-200 ease-out"
|
||||
style="width: {percent}%"
|
||||
></div>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="h-1 w-full overflow-hidden rounded-full bg-muted">
|
||||
<div
|
||||
class="h-full animate-pulse bg-primary transition-[width] duration-200 ease-out"
|
||||
class="h-full bg-primary transition-[width] duration-200 ease-out"
|
||||
style="width: {percent}%"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
@@ -29,11 +29,8 @@
|
||||
size = 'h-9 w-9'
|
||||
}: Props = $props();
|
||||
|
||||
let avatarError = $state(false);
|
||||
let quantError = $state(false);
|
||||
|
||||
let orgAvatarFailed = $derived(avatarError || failedAvatarOrgs.has(org));
|
||||
let quantAvatarFailed = $derived(quantError || failedAvatarOrgs.has(quantOrg ?? ''));
|
||||
let orgAvatarFailed = $derived(failedAvatarOrgs.has(org));
|
||||
let quantAvatarFailed = $derived(failedAvatarOrgs.has(quantOrg ?? ''));
|
||||
|
||||
let invertAvatar = $derived(DARK_INVERT_AVATAR_ORGS.includes(org));
|
||||
let invertQuant = $derived(DARK_INVERT_AVATAR_ORGS.includes(quantOrg ?? ''));
|
||||
@@ -76,7 +73,6 @@
|
||||
loading="lazy"
|
||||
onerror={() => {
|
||||
failedAvatarOrgs.add(org);
|
||||
avatarError = true;
|
||||
}}
|
||||
src={HuggingFaceService.getAvatarUrl(org)}
|
||||
/>
|
||||
@@ -104,7 +100,6 @@
|
||||
loading="lazy"
|
||||
onerror={() => {
|
||||
failedAvatarOrgs.add(quantOrg ?? '');
|
||||
quantError = true;
|
||||
}}
|
||||
src={HuggingFaceService.getAvatarUrl(quantOrg)}
|
||||
/>
|
||||
|
||||
@@ -28,8 +28,8 @@ export function formatFileSize(bytes: number | unknown): string {
|
||||
/**
|
||||
* Format parameter count to human-readable format (B, M, K)
|
||||
*
|
||||
* Billions render as whole numbers (`176.94e9` -> `177B`): the decimals are
|
||||
* noise at badge sizes and id-parsed counts are whole anyway (`Qwen3-8B`).
|
||||
* Billions keep one decimal for hub counts (`15.2B`) and none for whole
|
||||
* values (id-parsed counts are integers anyway, e.g. `8B`).
|
||||
*
|
||||
* @param params - Parameter count
|
||||
* @returns Human-readable parameter count
|
||||
@@ -38,7 +38,9 @@ export function formatParameters(params: number | unknown): string {
|
||||
if (typeof params !== 'number') return 'Unknown';
|
||||
|
||||
if (params >= 1e9) {
|
||||
return `${Math.round(params / 1e9)}B`;
|
||||
const billions = params / 1e9;
|
||||
|
||||
return `${Number.isInteger(billions) ? billions : billions.toFixed(1)}B`;
|
||||
}
|
||||
|
||||
if (params >= 1e6) {
|
||||
|
||||
Reference in New Issue
Block a user