Studio: surface Apply for a chat-template-only edit so the override reloads (#6514)

Co-authored-by: Unsloth <michaelhan@Michaels-MacBook-Pro.local>
This commit is contained in:
Michael Han 2026-06-21 02:26:36 -07:00 committed by GitHub
commit 4098b4977e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -546,6 +546,12 @@ export function ChatSettingsPanel({
const loadedTensorParallel = useChatRuntimeStore(
(s) => s.loadedTensorParallel,
);
const chatTemplateOverride = useChatRuntimeStore(
(s) => s.chatTemplateOverride,
);
const loadedChatTemplateOverride = useChatRuntimeStore(
(s) => s.loadedChatTemplateOverride,
);
const customContextLength = useChatRuntimeStore((s) => s.customContextLength);
const setCustomContextLength = useChatRuntimeStore(
(s) => s.setCustomContextLength,
@ -584,8 +590,11 @@ export function ChatSettingsPanel({
const specDirty = speculativeType !== loadedSpeculativeType;
const specDraftDirty = specDraftNMax !== loadedSpecDraftNMax;
const tpDirty = tensorParallel !== (loadedTensorParallel ?? false);
// A saved chat-template override is a reload-time setting too, so surface
// Apply for a template-only edit (otherwise it could never be applied).
const templateDirty = chatTemplateOverride !== loadedChatTemplateOverride;
const modelSettingsDirty =
kvDirty || ctxDirty || specDirty || specDraftDirty || tpDirty;
kvDirty || ctxDirty || specDirty || specDraftDirty || tpDirty || templateDirty;
const [presetNameInput, setPresetNameInput] = useState(activePreset);
const [systemPromptEditorOpen, setSystemPromptEditorOpen] = useState(false);
const [systemPromptDraft, setSystemPromptDraft] = useState("");