Studio: fix llama.cpp update toast tag and reload hint
The post-update toast used the job's to_tag, which is the bare bNNNN build number (same as installed_tag), so it showed e.g. "b9726" instead of the full release tag. Use status.latest_tag (e.g. b9726-mix-<sha>) to match the tag the banner already shows, falling back to to_tag and then a generic label. Also drop "Reload your model to use it." when there is nothing to reload: only append it when a local model is loaded, since external-provider models do not use llama.cpp.
This commit is contained in:
parent
e1ae4756d9
commit
66781abc58
1 changed files with 13 additions and 3 deletions
|
|
@ -2,6 +2,7 @@
|
|||
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { isExternalModelId, useChatRuntimeStore } from "@/features/chat";
|
||||
import { useLlamaUpdateCheck } from "@/hooks/use-llama-update-check";
|
||||
import { useShowLlamaUpdateBanner } from "@/hooks/use-llama-update-pref";
|
||||
import { toast } from "@/lib/toast";
|
||||
|
|
@ -99,9 +100,18 @@ export function LlamaUpdateBanner({
|
|||
async function handleUpdate() {
|
||||
const result = await apply();
|
||||
if (result?.ok) {
|
||||
toast.success(
|
||||
`llama.cpp updated to ${result.tag ?? "the latest build"}. Reload your model to use it.`,
|
||||
);
|
||||
// Prefer the full release tag (e.g. b9726-mix-<sha>); the job's to_tag and
|
||||
// installed_tag are the bare bNNNN build number.
|
||||
const updatedTag = status?.latest_tag ?? result.tag ?? "the latest build";
|
||||
// Only a loaded local model can be reloaded to pick up the new binary;
|
||||
// external-provider models do not use llama.cpp at all.
|
||||
const checkpoint = useChatRuntimeStore.getState().params.checkpoint;
|
||||
const hasLocalModel =
|
||||
Boolean(checkpoint) && !isExternalModelId(checkpoint);
|
||||
const reloadHint = hasLocalModel
|
||||
? " Reload your model to use it."
|
||||
: "";
|
||||
toast.success(`llama.cpp updated to ${updatedTag}.${reloadHint}`);
|
||||
} else if (result) {
|
||||
toast.error(
|
||||
`llama.cpp update failed: ${result.error ?? "unknown error"}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue