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 '<model>-gguf' -> '<model>-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 '<checkpoint>_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 <michaelhan2050@gmail.com>
This commit is contained in:
parent
4e8d0da8f9
commit
307455762c
2 changed files with 4 additions and 2 deletions
|
|
@ -320,7 +320,7 @@ export function ExportRunPanel(props: ExportRunPanelProps) {
|
|||
Model Name
|
||||
</label>
|
||||
<Input
|
||||
placeholder="my-model-gguf"
|
||||
placeholder="my-model-GGUF"
|
||||
value={modelName}
|
||||
onChange={(e) => onModelNameChange(e.target.value)}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue