Upload 2 files
Browse files
README.md
CHANGED
|
@@ -52,7 +52,7 @@ Run it:
|
|
| 52 |
llama serve -m ./voiced/model.gguf
|
| 53 |
```
|
| 54 |
|
| 55 |
-
> **We tried it on Orion
|
| 56 |
|
| 57 |
No adapter at runtime. `voice cast` bakes the voice into a complete `.gguf` — the head at `Q8_0`, everything else untouched. Just `llama serve -m`.
|
| 58 |
|
|
|
|
| 52 |
llama serve -m ./voiced/model.gguf
|
| 53 |
```
|
| 54 |
|
| 55 |
+
> **We tried it on Orion:** full comparison (314 benchmark items, 32 writing pairs) in [Evaluation](#evaluation). Same cast on its abliterated sibling [llmfan46/gemma-4-26B-A4B-it-qat-q4_0-unquantized-uncensored-heretic](https://huggingface.co/llmfan46/gemma-4-26B-A4B-it-qat-q4_0-unquantized-uncensored-heretic) looped; re-cast as `delta` stopped looping and kept the voice — one file out, same family/shape required.
|
| 56 |
|
| 57 |
No adapter at runtime. `voice cast` bakes the voice into a complete `.gguf` — the head at `Q8_0`, everything else untouched. Just `llama serve -m`.
|
| 58 |
|
voice.py
CHANGED
|
@@ -3430,7 +3430,7 @@ def _compute_delta(voice_path, base_path, delta_folder, delta_name, args=None):
|
|
| 3430 |
header = {
|
| 3431 |
vname: {"dtype": "F16", "shape": list(delta_f16.shape), "data_offsets": [0, total_elems * 2]},
|
| 3432 |
"delta.voice.marker": {"dtype": "U8", "shape": [1], "data_offsets": [total_elems * 2, total_elems * 2 + 1]},
|
| 3433 |
-
"__metadata__": {"type": "delta", "base": str(base_path), "voice": str(voice_path)},
|
| 3434 |
}
|
| 3435 |
hj = json.dumps(header).encode("utf-8")
|
| 3436 |
with open(tmp_out, "wb") as out:
|
|
@@ -3497,7 +3497,7 @@ def _compute_delta(voice_path, base_path, delta_folder, delta_name, args=None):
|
|
| 3497 |
header = {
|
| 3498 |
vname: {"dtype": "F16", "shape": list(vshape), "data_offsets": [0, total_elems * 2]},
|
| 3499 |
marker_name: {"dtype": "U8", "shape": [1], "data_offsets": [total_elems * 2, total_elems * 2 + 1]},
|
| 3500 |
-
"__metadata__": {"type": "delta", "base": str(base_path), "voice": str(voice_path)},
|
| 3501 |
}
|
| 3502 |
hj = json.dumps(header).encode("utf-8")
|
| 3503 |
|
|
@@ -3769,6 +3769,42 @@ def _list_bases():
|
|
| 3769 |
# CMD: info
|
| 3770 |
# ---------------------------------------------------------------------------
|
| 3771 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3772 |
def cmd_info(args):
|
| 3773 |
voicename = args.voicename.strip()
|
| 3774 |
voice_path, voice_meta = _registry_resolve(voicename)
|
|
@@ -3807,6 +3843,8 @@ def cmd_info(args):
|
|
| 3807 |
_say(f" License: {_trunc(meta['license'], 80)}")
|
| 3808 |
_say(f" Saved: {meta.get('downloaded_at', meta.get('fetched_at', '—'))}")
|
| 3809 |
_say(f" File: {voice_path}")
|
|
|
|
|
|
|
| 3810 |
|
| 3811 |
|
| 3812 |
# ---------------------------------------------------------------------------
|
|
|
|
| 3430 |
header = {
|
| 3431 |
vname: {"dtype": "F16", "shape": list(delta_f16.shape), "data_offsets": [0, total_elems * 2]},
|
| 3432 |
"delta.voice.marker": {"dtype": "U8", "shape": [1], "data_offsets": [total_elems * 2, total_elems * 2 + 1]},
|
| 3433 |
+
"__metadata__": {"type": "delta", "base": _public_source(str(base_path)), "voice": _public_source(str(voice_path))},
|
| 3434 |
}
|
| 3435 |
hj = json.dumps(header).encode("utf-8")
|
| 3436 |
with open(tmp_out, "wb") as out:
|
|
|
|
| 3497 |
header = {
|
| 3498 |
vname: {"dtype": "F16", "shape": list(vshape), "data_offsets": [0, total_elems * 2]},
|
| 3499 |
marker_name: {"dtype": "U8", "shape": [1], "data_offsets": [total_elems * 2, total_elems * 2 + 1]},
|
| 3500 |
+
"__metadata__": {"type": "delta", "base": _public_source(str(base_path)), "voice": _public_source(str(voice_path))},
|
| 3501 |
}
|
| 3502 |
hj = json.dumps(header).encode("utf-8")
|
| 3503 |
|
|
|
|
| 3769 |
# CMD: info
|
| 3770 |
# ---------------------------------------------------------------------------
|
| 3771 |
|
| 3772 |
+
|
| 3773 |
+
def _verify_voice_file(path, meta):
|
| 3774 |
+
"""Cross-check voice.json claims against the artifact's own header.
|
| 3775 |
+
Returns warning strings (empty = agrees). Never raises: an unreadable
|
| 3776 |
+
file is a note, not a failure."""
|
| 3777 |
+
out = []
|
| 3778 |
+
if str(path).endswith(".gguf"):
|
| 3779 |
+
return out # quant type names differ; nothing truthful to compare
|
| 3780 |
+
try:
|
| 3781 |
+
header, tens = read_safetensors(str(path))
|
| 3782 |
+
except Exception:
|
| 3783 |
+
return [" ? Could not read the artifact header; showing voice.json as-is."]
|
| 3784 |
+
names = [k for k in tens if k != "delta.voice.marker"]
|
| 3785 |
+
tname = meta.get("tensor_name")
|
| 3786 |
+
if tname not in tens and names:
|
| 3787 |
+
tname = names[0]
|
| 3788 |
+
if tname not in tens:
|
| 3789 |
+
return [" ? No tensors found in the artifact."]
|
| 3790 |
+
info = tens[tname]
|
| 3791 |
+
claimed_shape = meta.get("shape")
|
| 3792 |
+
if claimed_shape is not None and list(claimed_shape) != list(info["shape"]):
|
| 3793 |
+
out.append(f" ! MISMATCH shape: voice.json says {list(claimed_shape)}, "
|
| 3794 |
+
f"file holds {list(info['shape'])} — file wins.")
|
| 3795 |
+
claimed_dtype = (meta.get("dtype") or "").upper()
|
| 3796 |
+
if claimed_dtype and claimed_dtype != str(info["dtype"]).upper():
|
| 3797 |
+
out.append(f" ! MISMATCH dtype: voice.json says {meta.get('dtype')}, "
|
| 3798 |
+
f"file holds {info['dtype']} — file wins.")
|
| 3799 |
+
has_marker = "delta.voice.marker" in tens
|
| 3800 |
+
if meta.get("type") == "delta" and not has_marker:
|
| 3801 |
+
out.append(" ! voice.json claims delta but the file has no delta marker.")
|
| 3802 |
+
if meta.get("type") != "delta" and has_marker:
|
| 3803 |
+
out.append(" ! File carries a delta marker but voice.json type is "
|
| 3804 |
+
f"'{meta.get('type', 'voice')}'.")
|
| 3805 |
+
return out
|
| 3806 |
+
|
| 3807 |
+
|
| 3808 |
def cmd_info(args):
|
| 3809 |
voicename = args.voicename.strip()
|
| 3810 |
voice_path, voice_meta = _registry_resolve(voicename)
|
|
|
|
| 3843 |
_say(f" License: {_trunc(meta['license'], 80)}")
|
| 3844 |
_say(f" Saved: {meta.get('downloaded_at', meta.get('fetched_at', '—'))}")
|
| 3845 |
_say(f" File: {voice_path}")
|
| 3846 |
+
for w in _verify_voice_file(str(voice_path), meta):
|
| 3847 |
+
_warn(w)
|
| 3848 |
|
| 3849 |
|
| 3850 |
# ---------------------------------------------------------------------------
|