chore: switch helper and no-cache fallback to Gemma (#5066)
This commit is contained in:
parent
bc9ddb3af6
commit
ee86530e55
2 changed files with 9 additions and 9 deletions
|
|
@ -26,7 +26,7 @@ from loggers import get_logger
|
|||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
DEFAULT_HELPER_MODEL_REPO = "unsloth/Qwen3.5-4B-GGUF"
|
||||
DEFAULT_HELPER_MODEL_REPO = "unsloth/gemma-4-E2B-it-GGUF"
|
||||
DEFAULT_HELPER_MODEL_VARIANT = "UD-Q4_K_XL"
|
||||
|
||||
README_MAX_CHARS = 1500
|
||||
|
|
|
|||
|
|
@ -455,13 +455,13 @@ async function autoLoadSmallestModel(): Promise<{
|
|||
// No cached models found — try downloading a small default GGUF
|
||||
toast("Downloading a small model…", {
|
||||
id: toastId,
|
||||
description: "No downloaded models found. Fetching Qwen3.5-4B (UD-Q4_K_XL).",
|
||||
description: "No downloaded models found. Fetching Gemma-4-E2B-it (UD-Q4_K_XL).",
|
||||
duration: 30000,
|
||||
});
|
||||
try {
|
||||
if (
|
||||
!(await canAutoLoad({
|
||||
model_path: "unsloth/Qwen3.5-4B-GGUF",
|
||||
model_path: "unsloth/gemma-4-E2B-it-GGUF",
|
||||
max_seq_length: 0,
|
||||
is_lora: false,
|
||||
gguf_variant: "UD-Q4_K_XL",
|
||||
|
|
@ -471,7 +471,7 @@ async function autoLoadSmallestModel(): Promise<{
|
|||
return { loaded: false, blockedByTrustRemoteCode };
|
||||
}
|
||||
const loadResp = await loadModel({
|
||||
model_path: "unsloth/Qwen3.5-4B-GGUF",
|
||||
model_path: "unsloth/gemma-4-E2B-it-GGUF",
|
||||
hf_token: hfToken,
|
||||
max_seq_length: 0,
|
||||
load_in_4bit: true,
|
||||
|
|
@ -479,20 +479,20 @@ async function autoLoadSmallestModel(): Promise<{
|
|||
gguf_variant: "UD-Q4_K_XL",
|
||||
trust_remote_code: trustRemoteCode,
|
||||
});
|
||||
useChatRuntimeStore.getState().setCheckpoint("unsloth/Qwen3.5-4B-GGUF", "UD-Q4_K_XL");
|
||||
useChatRuntimeStore.getState().setCheckpoint("unsloth/gemma-4-E2B-it-GGUF", "UD-Q4_K_XL");
|
||||
const store = useChatRuntimeStore.getState();
|
||||
store.setModelRequiresTrustRemoteCode(
|
||||
loadResp.requires_trust_remote_code ?? false,
|
||||
);
|
||||
store.setParams({ ...store.params, maxTokens: loadResp.context_length ?? 131072 });
|
||||
const defaultModel: ChatModelSummary = {
|
||||
id: "unsloth/Qwen3.5-4B-GGUF",
|
||||
name: loadResp.display_name ?? "Qwen3.5-4B-GGUF",
|
||||
id: "unsloth/gemma-4-E2B-it-GGUF",
|
||||
name: loadResp.display_name ?? "gemma-4-E2B-it-GGUF",
|
||||
isVision: loadResp.is_vision ?? false,
|
||||
isLora: false,
|
||||
isGguf: true,
|
||||
};
|
||||
if (!store.models.some((m) => m.id === "unsloth/Qwen3.5-4B-GGUF")) {
|
||||
if (!store.models.some((m) => m.id === "unsloth/gemma-4-E2B-it-GGUF")) {
|
||||
store.setModels([...store.models, defaultModel]);
|
||||
}
|
||||
useChatRuntimeStore.setState({
|
||||
|
|
@ -509,7 +509,7 @@ async function autoLoadSmallestModel(): Promise<{
|
|||
defaultChatTemplate: loadResp.chat_template ?? null,
|
||||
chatTemplateOverride: null,
|
||||
});
|
||||
toast.success("Loaded Qwen3.5-4B (UD-Q4_K_XL)", { id: toastId });
|
||||
toast.success("Loaded Gemma-4-E2B-it (UD-Q4_K_XL)", { id: toastId });
|
||||
return { loaded: true, blockedByTrustRemoteCode: false };
|
||||
} catch {
|
||||
toast.dismiss(toastId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue