mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-10-03 03:17:32 -05:00
ui : fix the context column reading the hub
Assisted-by: pi:llama.cpp/DeepSeek-V4.1-Flash
This commit is contained in:
@@ -68,6 +68,6 @@
|
||||
let context = $derived(reported ?? fetched);
|
||||
</script>
|
||||
|
||||
<span class={['text-sm text-muted-foreground', className]}>
|
||||
<span bind:this={el} class={['text-sm text-muted-foreground', className]}>
|
||||
{context ? `${formatParameters(context)} tokens` : '—'}
|
||||
</span>
|
||||
|
||||
@@ -517,7 +517,13 @@ export class HuggingFaceService {
|
||||
|
||||
if (!response.ok) throw new Error(`Failed to fetch model details: ${response.status}`);
|
||||
|
||||
const data = (await response.json()) as HfModelDetailInfo;
|
||||
// the hub answers with a list of provider entries for one repo, and the
|
||||
// gguf and card data sit on the entry that carries them
|
||||
const payload = (await response.json()) as HfModelDetailInfo | HfModelDetailInfo[];
|
||||
const entries = Array.isArray(payload) ? payload : [payload];
|
||||
const data = entries.find((entry) => entry?.gguf ?? entry?.cardData) ?? entries[0];
|
||||
|
||||
if (!data) return null;
|
||||
|
||||
HuggingFaceService.detailsCache.set(modelId, data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user