Upload 3 files
Browse files
DOCS.md
CHANGED
|
@@ -1,110 +1,204 @@
|
|
| 1 |
# voice — Help
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
## voice --help
|
| 6 |
|
| 7 |
```
|
| 8 |
-
usage: voice [-h] [-v]
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
positional arguments:
|
| 13 |
-
{get,cast,
|
| 14 |
-
get Get a voice from a
|
| 15 |
-
cast Cast a voice onto
|
| 16 |
-
|
| 17 |
-
|
| 18 |
list List stored voices
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
options:
|
| 23 |
-h, --help show this help message and exit
|
| 24 |
-
-v, --verbose
|
|
|
|
|
|
|
|
|
|
| 25 |
```
|
| 26 |
|
| 27 |
-
## voice get
|
| 28 |
|
| 29 |
```
|
| 30 |
-
usage: voice get [-h] [-q]
|
|
|
|
|
|
|
| 31 |
|
| 32 |
positional arguments:
|
| 33 |
-
|
| 34 |
|
| 35 |
options:
|
| 36 |
-
-h, --help
|
| 37 |
-
-q, --quiet
|
|
|
|
|
|
|
| 38 |
```
|
| 39 |
|
| 40 |
-
## voice
|
| 41 |
|
| 42 |
```
|
| 43 |
-
usage: voice
|
|
|
|
|
|
|
| 44 |
|
| 45 |
positional arguments:
|
| 46 |
-
|
|
|
|
| 47 |
|
| 48 |
options:
|
| 49 |
-h, --help show this help message and exit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
```
|
| 51 |
|
| 52 |
-
## voice
|
| 53 |
|
| 54 |
```
|
| 55 |
-
usage: voice
|
|
|
|
|
|
|
| 56 |
|
| 57 |
positional arguments:
|
| 58 |
-
|
| 59 |
-
voice Voice name (from registry) or path to .safetensors
|
| 60 |
|
| 61 |
options:
|
| 62 |
-
-
|
| 63 |
-
--out OUT
|
| 64 |
-
|
| 65 |
```
|
| 66 |
|
| 67 |
-
## voice
|
| 68 |
|
| 69 |
```
|
| 70 |
-
usage: voice
|
|
|
|
|
|
|
| 71 |
|
| 72 |
positional arguments:
|
| 73 |
-
|
|
|
|
| 74 |
|
| 75 |
options:
|
| 76 |
-
-
|
|
|
|
|
|
|
| 77 |
```
|
| 78 |
|
| 79 |
-
## voice
|
| 80 |
|
| 81 |
```
|
| 82 |
-
usage: voice
|
|
|
|
|
|
|
| 83 |
|
| 84 |
positional arguments:
|
| 85 |
-
voicename
|
| 86 |
|
| 87 |
options:
|
| 88 |
-
-h, --help
|
|
|
|
|
|
|
| 89 |
```
|
| 90 |
|
| 91 |
-
## voice
|
| 92 |
|
| 93 |
```
|
| 94 |
-
usage: voice
|
|
|
|
|
|
|
| 95 |
|
| 96 |
positional arguments:
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
options:
|
| 100 |
-h, --help show this help message and exit
|
|
|
|
| 101 |
```
|
| 102 |
|
| 103 |
-
## voice
|
| 104 |
|
| 105 |
```
|
| 106 |
-
usage: voice
|
|
|
|
|
|
|
| 107 |
|
| 108 |
options:
|
| 109 |
-h, --help show this help message and exit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
```
|
|
|
|
| 1 |
# voice — Help
|
| 2 |
|
| 3 |
+
Generated from `voice --help` and `voice <cmd> --help` (v2.0.0, 11 commands).
|
| 4 |
|
| 5 |
## voice --help
|
| 6 |
|
| 7 |
```
|
| 8 |
+
usage: voice [-h] [-v] [--non-interactive] [--version]
|
| 9 |
+
[--completion {bash,zsh,fish}]
|
| 10 |
+
{get,cast,tensor,delta,list,info,remove,cleanup,auth,path,doctor} ...
|
| 11 |
|
| 12 |
+
Lift a model's voice and cast it onto another model.
|
| 13 |
|
| 14 |
positional arguments:
|
| 15 |
+
{get,cast,tensor,delta,list,info,remove,cleanup,auth,path,doctor}
|
| 16 |
+
get Get a voice from a model (safetensors repo, .gguf, or URL)
|
| 17 |
+
cast Cast a voice onto a .gguf or .safetensors file
|
| 18 |
+
tensor Extract or cast any named tensor
|
| 19 |
+
delta Make a reusable style (voice − base)
|
| 20 |
list List stored voices
|
| 21 |
+
info Show voice details
|
| 22 |
+
remove Remove a stored voice
|
| 23 |
+
cleanup Remove incomplete downloads
|
| 24 |
+
auth Save your HF token (optional)
|
| 25 |
+
path Put voice on your PATH
|
| 26 |
+
doctor Check your setup
|
| 27 |
|
| 28 |
options:
|
| 29 |
-h, --help show this help message and exit
|
| 30 |
+
-v, --verbose
|
| 31 |
+
--non-interactive
|
| 32 |
+
--version
|
| 33 |
+
--completion {bash,zsh,fish}
|
| 34 |
```
|
| 35 |
|
| 36 |
+
## voice get
|
| 37 |
|
| 38 |
```
|
| 39 |
+
usage: voice get [-h] [-q] [--name NAME] [--yes] source
|
| 40 |
+
|
| 41 |
+
Get a voice from a model (safetensors repo, .gguf, or URL)
|
| 42 |
|
| 43 |
positional arguments:
|
| 44 |
+
source HF model ID, .gguf/.safetensors path, or URL
|
| 45 |
|
| 46 |
options:
|
| 47 |
+
-h, --help show this help message and exit
|
| 48 |
+
-q, --quiet Skip license detection
|
| 49 |
+
--name NAME Voice name to save
|
| 50 |
+
--yes Auto-confirm overwrites
|
| 51 |
```
|
| 52 |
|
| 53 |
+
## voice cast
|
| 54 |
|
| 55 |
```
|
| 56 |
+
usage: voice cast [-h] [--out OUT] [--yes] target voice
|
| 57 |
+
|
| 58 |
+
Cast a voice onto a .gguf or .safetensors file
|
| 59 |
|
| 60 |
positional arguments:
|
| 61 |
+
target Path to the target .gguf or .safetensors
|
| 62 |
+
voice Voice name, or a .safetensors/.gguf path
|
| 63 |
|
| 64 |
options:
|
| 65 |
-h, --help show this help message and exit
|
| 66 |
+
--out OUT Output file (default: alongside the target)
|
| 67 |
+
--yes Auto-confirm overwrites
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
## voice tensor
|
| 71 |
+
|
| 72 |
+
```
|
| 73 |
+
usage: voice tensor [-h] {get,cast} ...
|
| 74 |
+
|
| 75 |
+
Extract or cast any named tensor
|
| 76 |
```
|
| 77 |
|
| 78 |
+
### voice tensor get
|
| 79 |
|
| 80 |
```
|
| 81 |
+
usage: voice tensor get [-h] [--tensor TENSOR] [--out OUT] [--yes] source
|
| 82 |
+
|
| 83 |
+
Extract any named tensor to a .safetensors file
|
| 84 |
|
| 85 |
positional arguments:
|
| 86 |
+
source HF model ID, .gguf/.safetensors path, or URL
|
|
|
|
| 87 |
|
| 88 |
options:
|
| 89 |
+
--tensor TENSOR Tensor name (default: auto-detect the output head)
|
| 90 |
+
--out OUT Output .safetensors path
|
| 91 |
+
--yes Auto-confirm overwrites
|
| 92 |
```
|
| 93 |
|
| 94 |
+
### voice tensor cast
|
| 95 |
|
| 96 |
```
|
| 97 |
+
usage: voice tensor cast [-h] [--tensor TENSOR] [--out OUT] [--yes] target tensor_file
|
| 98 |
+
|
| 99 |
+
Cast any named tensor onto a .gguf or .safetensors file
|
| 100 |
|
| 101 |
positional arguments:
|
| 102 |
+
target Path to the target .gguf or .safetensors
|
| 103 |
+
tensor_file Path to a .safetensors/.gguf containing the tensor
|
| 104 |
|
| 105 |
options:
|
| 106 |
+
--tensor TENSOR Tensor name (default: the file's output head or only tensor)
|
| 107 |
+
--out OUT Output file
|
| 108 |
+
--yes Auto-confirm overwrites
|
| 109 |
```
|
| 110 |
|
| 111 |
+
## voice delta
|
| 112 |
|
| 113 |
```
|
| 114 |
+
usage: voice delta [-h] [--base BASE] [--yes] [voicename]
|
| 115 |
+
|
| 116 |
+
Make a reusable style (voice − base)
|
| 117 |
|
| 118 |
positional arguments:
|
| 119 |
+
voicename Voice name from registry (from voice list)
|
| 120 |
|
| 121 |
options:
|
| 122 |
+
-h, --help show this help message and exit
|
| 123 |
+
--base BASE Base HF repo (org/model)
|
| 124 |
+
--yes Auto-confirm overwrites
|
| 125 |
```
|
| 126 |
|
| 127 |
+
## voice list
|
| 128 |
|
| 129 |
```
|
| 130 |
+
usage: voice list [-h] [--base] [{base}]
|
| 131 |
+
|
| 132 |
+
List stored voices
|
| 133 |
|
| 134 |
positional arguments:
|
| 135 |
+
{base} List bases instead of voices
|
| 136 |
+
|
| 137 |
+
options:
|
| 138 |
+
-h, --help show this help message and exit
|
| 139 |
+
--base List cached base heads (alias for 'voice list base')
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
## voice info
|
| 143 |
+
|
| 144 |
+
```
|
| 145 |
+
usage: voice info [-h] voicename
|
| 146 |
+
|
| 147 |
+
Show voice details
|
| 148 |
+
```
|
| 149 |
+
|
| 150 |
+
## voice remove
|
| 151 |
+
|
| 152 |
+
```
|
| 153 |
+
usage: voice remove [-h] [--yes] voice
|
| 154 |
+
|
| 155 |
+
Remove a stored voice
|
| 156 |
+
```
|
| 157 |
+
|
| 158 |
+
## voice cleanup
|
| 159 |
+
|
| 160 |
+
```
|
| 161 |
+
usage: voice cleanup [-h] [--force]
|
| 162 |
+
|
| 163 |
+
Remove incomplete downloads
|
| 164 |
|
| 165 |
options:
|
| 166 |
-h, --help show this help message and exit
|
| 167 |
+
--force Remove even active downloads
|
| 168 |
```
|
| 169 |
|
| 170 |
+
## voice auth
|
| 171 |
|
| 172 |
```
|
| 173 |
+
usage: voice auth [-h] [--clear] [--show]
|
| 174 |
+
|
| 175 |
+
Save your HF token (optional)
|
| 176 |
|
| 177 |
options:
|
| 178 |
-h, --help show this help message and exit
|
| 179 |
+
--clear Remove stored token
|
| 180 |
+
--show Show if token is present (masked)
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
+
## voice path
|
| 184 |
+
|
| 185 |
+
```
|
| 186 |
+
usage: voice path [-h]
|
| 187 |
+
|
| 188 |
+
Put voice on your PATH
|
| 189 |
+
```
|
| 190 |
+
|
| 191 |
+
## voice doctor
|
| 192 |
+
|
| 193 |
+
```
|
| 194 |
+
usage: voice doctor [-h]
|
| 195 |
+
|
| 196 |
+
Check your setup
|
| 197 |
+
```
|
| 198 |
+
|
| 199 |
+
## voice --version
|
| 200 |
+
|
| 201 |
+
```
|
| 202 |
+
voice --version # show version + environment
|
| 203 |
+
voice --completion bash|zsh|fish # print shell completion
|
| 204 |
```
|
README.md
CHANGED
|
@@ -76,12 +76,30 @@ No adapter at runtime. `voice cast` bakes the voice into a complete `.gguf` —
|
|
| 76 |
|
| 77 |
---
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
## How it works
|
| 80 |
|
| 81 |
Two benefits, no extras to learn:
|
| 82 |
|
| 83 |
-
- **Get what you need:** Light and fast — pulled with range requests in seconds, saved as one tensor (`voice.safetensors` + `voice.json`). `voice list` to see, `voice info` to inspect.
|
| 84 |
-
- **Run fused:** Cast writes a complete model you can run anywhere. No extra setup.
|
| 85 |
|
| 86 |
You will see each step as it happens and get a ready-to-run file at the end.
|
| 87 |
|
|
@@ -102,17 +120,22 @@ A delta carries only the difference from its base, so it blends more gently with
|
|
| 102 |
|
| 103 |
## Commands
|
| 104 |
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
| Command | Description |
|
| 108 |
-
|---|---|
|
| 109 |
-
| `voice get <
|
| 110 |
-
| `voice
|
| 111 |
-
| `voice
|
| 112 |
-
| `voice
|
| 113 |
-
| `voice
|
| 114 |
-
| `voice
|
| 115 |
-
| `voice
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
Example:
|
| 118 |
|
|
@@ -130,7 +153,7 @@ voice list base
|
|
| 130 |
voice cast ./model.gguf styletune-v2 --out ./voiced/
|
| 131 |
```
|
| 132 |
|
| 133 |
-
> `delta-` is reserved. Voice names cannot start with it. Deltas always do. Full CLI reference: [`DOCS.md`](./DOCS.md) (generated from `voice --help`,
|
| 134 |
|
| 135 |
|
| 136 |
## What StyleTune showed
|
|
@@ -228,7 +251,7 @@ curl http://localhost:8080/v1/chat/completions \
|
|
| 228 |
|
| 229 |
### Transformers (HF-native snippet—for the base or other safetensors voices)
|
| 230 |
|
| 231 |
-
The Voice tool extracts the `lm_head` from
|
| 232 |
|
| 233 |
```python
|
| 234 |
from transformers import pipeline
|
|
|
|
| 76 |
|
| 77 |
---
|
| 78 |
|
| 79 |
+
## The Idea — a scalpel for the community
|
| 80 |
+
|
| 81 |
+
Voice is a **scalpel, not a pipeline** — built for fast experimentation and iteration. One idea made trivial: lift a model's character and place it elsewhere, without friction, without hiccups.
|
| 82 |
+
|
| 83 |
+
**Backed by proven ideas:**
|
| 84 |
+
|
| 85 |
+
* **QAT-aware bases** — Google's Quantization-Aware Training (5k steps, fake-quant + KL to BF16) shows 54% less perplexity drop at Q4_0. The best base stays intact.
|
| 86 |
+
* **`lm_head` carries style** — the MythoMax lineage and Gryphe's StyleTune proved one tensor changes voice. We just make it portable.
|
| 87 |
+
|
| 88 |
+
**What that trivializes:**
|
| 89 |
+
|
| 90 |
+
* **Any format → any format:** `voice get` lifts the output-projection from **any** source — a Hugging Face `safetensors` repo, a local `.gguf`, or a direct URL — with range requests (no full download). `voice cast` fuses it onto **any** target — a `.gguf` *or* a `.safetensors` file. Transposes `[vocab, hidden]` ↔ `[hidden, vocab]` and `BF16`/`F16`/`F32` → `F32` → `Q8_0` automatically. The rest of the model is byte-copied.
|
| 91 |
+
* **Any tensor, anywhere:** `voice tensor get <source> --tensor <name>` extracts **any named tensor** from any file, `voice tensor cast <target> <file> [--tensor <name>]` drops it into any other file — GGUF-quant passthrough stays bit-exact when source and target share quantization, dequant-then-requant when crossing to safetensors, all with the same one-liner.
|
| 92 |
+
* **No surprises:** atomic writes, validated `safetensors` offsets, ETag-aware resume, verified HF token handling (0600), symlink-safe registry — so repeated `get`/`cast` on flaky links or shared disks just resumes or fails cleanly.
|
| 93 |
+
|
| 94 |
+
Result: keep the stronger model for reasoning, the better voice for style, and iterate in seconds. Mix Holodeck → Qwen, Darkside → Gemma, Serenity + Darkside, QAT + StyleTune — one file out, `llama serve -m` ready.
|
| 95 |
+
|
| 96 |
+
|
| 97 |
## How it works
|
| 98 |
|
| 99 |
Two benefits, no extras to learn:
|
| 100 |
|
| 101 |
+
- **Get what you need:** Light and fast — pulled with range requests in seconds, saved as one tensor (`voice.safetensors` or `voice.gguf` for quant passthrough + `voice.json`). `voice list` to see, `voice info` to inspect.
|
| 102 |
+
- **Run fused:** Cast writes a complete model you can run anywhere. No extra setup. Quant voices stay bit-exact `Q8_0`→`Q8_0`.
|
| 103 |
|
| 104 |
You will see each step as it happens and get a ready-to-run file at the end.
|
| 105 |
|
|
|
|
| 120 |
|
| 121 |
## Commands
|
| 122 |
|
| 123 |
+
Commands. One idea each — 11 commands, `voice --help` is the source of truth (`DOCS.md` generated from live `voice.py` v2.0.0):
|
| 124 |
+
|
| 125 |
+
| Command | Description | Source |
|
| 126 |
+
|---|---|---|
|
| 127 |
+
| `voice get <model>` | Get a voice from a safetensors repo, `.gguf`, or URL (any format in) | `voice.py:1512` `cmd_get` |
|
| 128 |
+
| `voice cast <target> <voice>` | Fuse a voice onto a `.gguf` or `.safetensors` file (any format out) | `voice.py:1616` `cmd_cast` |
|
| 129 |
+
| `voice tensor get <source> --tensor <n>` | Extract **any** named tensor to a standalone artifact (safetensors or gguf for quant) | `voice.py:1890` `cmd_tensor_get` |
|
| 130 |
+
| `voice tensor cast <target> <file>` | Cast **any** named tensor onto a `.gguf` or `.safetensors` file | `voice.py:1942` `cmd_tensor_cast` |
|
| 131 |
+
| `voice delta [name]` | Make a portable style (`voice − base` → `F16` delta) you can reuse across compatible models | `voice.py:1999` `cmd_delta` |
|
| 132 |
+
| `voice list [base]` | Show saved voices — `voice list base` shows cached base heads | `voice.py:2289` `cmd_list` |
|
| 133 |
+
| `voice info <voice>` | Show details for a saved voice, delta, or cached base | `voice.py:2303` `cmd_info` |
|
| 134 |
+
| `voice remove <voice>` | Remove a voice from your library | `voice.py:2347` `cmd_remove` |
|
| 135 |
+
| `voice cleanup [--force]` | Remove incomplete downloads (`.parts`) — skips active (<10 min) unless `--force` | `voice.py:2365` `cmd_cleanup` |
|
| 136 |
+
| `voice auth [--show\|--clear]` | Save your HF token (0600, optional, faster/verified) | `voice.py:2388` `cmd_auth` |
|
| 137 |
+
| `voice path` | Put `voice` on your PATH (symlink to `/usr/local/bin` or `~/.local/bin`) | `voice.py:2435` `cmd_path` |
|
| 138 |
+
| `voice doctor` | Check your setup — Python + uv + venv + disk + HF token + connectivity | `voice.py:2471` `cmd_doctor` |
|
| 139 |
|
| 140 |
Example:
|
| 141 |
|
|
|
|
| 153 |
voice cast ./model.gguf styletune-v2 --out ./voiced/
|
| 154 |
```
|
| 155 |
|
| 156 |
+
> `delta-` is reserved. Voice names cannot start with it. Deltas always do. Full CLI reference: [`DOCS.md`](./DOCS.md) (generated from `voice --help`, 11 commands). Names are lowercased when saved.
|
| 157 |
|
| 158 |
|
| 159 |
## What StyleTune showed
|
|
|
|
| 251 |
|
| 252 |
### Transformers (HF-native snippet—for the base or other safetensors voices)
|
| 253 |
|
| 254 |
+
The Voice tool extracts the output-projection tensor (`lm_head` and friends) from safetensors or GGUF models. For any HF `transformers` model (including the base below), the canonical snippet is:
|
| 255 |
|
| 256 |
```python
|
| 257 |
from transformers import pipeline
|
voice.py
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|