From 307455762c494712e6af438da362292645b256f3 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Mon, 22 Jun 2026 02:11:33 -0700 Subject: [PATCH] Use uppercase -GGUF suffix for GGUF export default names (#6538) * Use uppercase -GGUF suffix for GGUF export default names Match the HF/Unsloth GGUF repo convention (Model-GGUF). Default export save dir '-gguf' -> '-GGUF', the local-path sibling dir token '_gguf' -> '_GGUF', and the model-name placeholder 'my-model-gguf' -> 'my-model-GGUF'. Pre-filled defaults only; no backend/path logic change. * Keep local GGUF sibling dir lowercase to match backend cleanup The uppercase change to siblingGgufDirectory diverged from the backend's hard-coded intermediate '_gguf' dir (core/export/export.py), which the export relocates GGUFs out of and then deletes. With the user's save dir defaulting to '_GGUF', that no-longer-equal lowercase sibling would be relocated and removed, which can delete an existing export. Revert the sibling default to '_gguf'; the user-facing GGUF export name (buildRelativeSaveDirectory) keeps the uppercase -GGUF token. * Tighten GGUF sibling-dir comment * Trim comments to be more succinct --------- Co-authored-by: Daniel Han --- .../src/features/export/components/export-run-panel.tsx | 2 +- studio/frontend/src/features/export/export-page.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/studio/frontend/src/features/export/components/export-run-panel.tsx b/studio/frontend/src/features/export/components/export-run-panel.tsx index ebd35c2158..9e0edf7303 100644 --- a/studio/frontend/src/features/export/components/export-run-panel.tsx +++ b/studio/frontend/src/features/export/components/export-run-panel.tsx @@ -320,7 +320,7 @@ export function ExportRunPanel(props: ExportRunPanelProps) { Model Name onModelNameChange(e.target.value)} /> diff --git a/studio/frontend/src/features/export/export-page.tsx b/studio/frontend/src/features/export/export-page.tsx index 14022f4d19..4d3cfad5dc 100644 --- a/studio/frontend/src/features/export/export-page.tsx +++ b/studio/frontend/src/features/export/export-page.tsx @@ -84,7 +84,7 @@ function buildRelativeSaveDirectory( ): string { if (exportMethod === "gguf") { return `${(sourceBaseModelName.split("/").pop() ?? selectedModelIdx ?? "model") - .replace(/[^a-zA-Z0-9._-]/g, "-")}-gguf`; + .replace(/[^a-zA-Z0-9._-]/g, "-")}-GGUF`; } return `${selectedModelIdx ?? "model"}/${checkpoint}`; } @@ -93,6 +93,8 @@ function siblingGgufDirectory(sourcePath: string): string | null { const trimmed = sourcePath.trim().replace(/[\\/]+$/, ""); if (!trimmed) return null; const slash = Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\")); + // Lowercase `_gguf` matches the backend's intermediate dir (core/export/export.py); + // `_GGUF` would relocate+delete that sibling. if (slash < 0) return `${trimmed}_gguf`; const parent = slash === 0 || (slash === 2 && /^[A-Za-z]:/.test(trimmed))