Upload 2 files
Browse files- slimshard_gui.py +26 -2
slimshard_gui.py
CHANGED
|
@@ -48,6 +48,7 @@ from .slimshard import (
|
|
| 48 |
HPCConfig,
|
| 49 |
build_slimshard,
|
| 50 |
export_hf_bundle,
|
|
|
|
| 51 |
inspect_recovery_plan,
|
| 52 |
recover_from_shard,
|
| 53 |
regenerate,
|
|
@@ -267,6 +268,12 @@ class SlimShardGUI:
|
|
| 267 |
text="Regenerate from SlimShard",
|
| 268 |
variable=self.op_mode_var,
|
| 269 |
value="regenerate",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 270 |
).pack(side=tk.LEFT)
|
| 271 |
|
| 272 |
self._add_path_row(
|
|
@@ -335,11 +342,11 @@ class SlimShardGUI:
|
|
| 335 |
state="readonly",
|
| 336 |
).pack(side=tk.LEFT, padx=(0, 16))
|
| 337 |
|
| 338 |
-
ttk.Label(row_opt, text="
|
| 339 |
ttk.Combobox(
|
| 340 |
row_opt,
|
| 341 |
textvariable=self.quant_format_var,
|
| 342 |
-
values=("mixed", "q2_k", "q4_0", "exact"),
|
| 343 |
width=9,
|
| 344 |
state="readonly",
|
| 345 |
).pack(side=tk.LEFT, padx=(0, 16))
|
|
@@ -882,6 +889,23 @@ class SlimShardGUI:
|
|
| 882 |
stop_event=self._stop_event,
|
| 883 |
)
|
| 884 |
self._queue.put(("done", ("SlimShard Build Complete", res)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 885 |
else:
|
| 886 |
shard = self.shard_var.get().strip()
|
| 887 |
res = regenerate(
|
|
|
|
| 48 |
HPCConfig,
|
| 49 |
build_slimshard,
|
| 50 |
export_hf_bundle,
|
| 51 |
+
export_safetensors_to_gguf,
|
| 52 |
inspect_recovery_plan,
|
| 53 |
recover_from_shard,
|
| 54 |
regenerate,
|
|
|
|
| 268 |
text="Regenerate from SlimShard",
|
| 269 |
variable=self.op_mode_var,
|
| 270 |
value="regenerate",
|
| 271 |
+
).pack(side=tk.LEFT, padx=(0, 14))
|
| 272 |
+
ttk.Radiobutton(
|
| 273 |
+
mode_bar,
|
| 274 |
+
text="Export SafeTensors to GGUF (Q2_K / Q4_0 / BF16)",
|
| 275 |
+
variable=self.op_mode_var,
|
| 276 |
+
value="export-gguf",
|
| 277 |
).pack(side=tk.LEFT)
|
| 278 |
|
| 279 |
self._add_path_row(
|
|
|
|
| 342 |
state="readonly",
|
| 343 |
).pack(side=tk.LEFT, padx=(0, 16))
|
| 344 |
|
| 345 |
+
ttk.Label(row_opt, text="Format:").pack(side=tk.LEFT, padx=(0, 6))
|
| 346 |
ttk.Combobox(
|
| 347 |
row_opt,
|
| 348 |
textvariable=self.quant_format_var,
|
| 349 |
+
values=("mixed", "q2_k", "q4_0", "bf16", "exact"),
|
| 350 |
width=9,
|
| 351 |
state="readonly",
|
| 352 |
).pack(side=tk.LEFT, padx=(0, 16))
|
|
|
|
| 889 |
stop_event=self._stop_event,
|
| 890 |
)
|
| 891 |
self._queue.put(("done", ("SlimShard Build Complete", res)))
|
| 892 |
+
elif mode == "export-gguf":
|
| 893 |
+
shard = self.shard_var.get().strip()
|
| 894 |
+
cfg = self.config_var.get().strip() or None
|
| 895 |
+
fmt = self.quant_format_var.get()
|
| 896 |
+
if fmt == "exact":
|
| 897 |
+
fmt = "bf16"
|
| 898 |
+
res = export_safetensors_to_gguf(
|
| 899 |
+
shard,
|
| 900 |
+
out,
|
| 901 |
+
config=cfg,
|
| 902 |
+
quant_format=fmt,
|
| 903 |
+
device=self.device_var.get(),
|
| 904 |
+
verbose=False,
|
| 905 |
+
progress_cb=progress_cb,
|
| 906 |
+
stop_event=self._stop_event,
|
| 907 |
+
)
|
| 908 |
+
self._queue.put(("done", ("GGUF Export Complete", res)))
|
| 909 |
else:
|
| 910 |
shard = self.shard_var.get().strip()
|
| 911 |
res = regenerate(
|