Skip to content

Commit 4e4919b

Browse files
mirek190Matti Pulkkinen
authored andcommitted
Correct GLM-TTS model_specs_v1 metadata (0xShug0#123)
* Update GLM-TTS model spec v1 metadata * Use normalized GLM-TTS request options
1 parent 9585590 commit 4e4919b

6 files changed

Lines changed: 30 additions & 24 deletions

File tree

docs/community_models/glm_tts.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,15 @@ audiocpp_cli --task clon --family glm_tts \
8989
| `--top-k` | integer | `25` | Speech-token top-k limit. |
9090
| `--top-p` | float | `0.8` | Speech-token nucleus threshold. |
9191
| `--seed` | integer | `0` | Seed used by token sampling, Flow noise, and HiFT. |
92-
| `--request-option flow_steps=<n>` | integer | `10` | Flow Euler integration steps. |
93-
| `--request-option cfg_rate=<float>` | float | `0.7` | Flow classifier-free guidance rate. |
94-
| `--request-option flow_noise_file=<path>` | raw F32 path | none | Optional exact initial Flow noise for parity tests. |
95-
| `--request-option hift_source_random_file=<path>` | raw F32 path | none | Optional exact HiFT phase-uniform and Gaussian values for parity tests. |
96-
| `--request-option hift_prior_noise_values=<n>` | integer | `0` | Torch RNG offset before normal HiFT source generation. |
92+
| `--request-option num_inference_steps=<n>` | integer | `10` | Flow Euler integration steps. |
93+
| `--request-option flow_guidance_scale=<float>` | float | `0.7` | Flow classifier-free guidance rate. |
94+
| `--request-option flow_noise_path=<path>` | raw F32 path | none | Optional exact initial Flow noise for parity tests. |
95+
| `--request-option hift_source_random_path=<path>` | raw F32 path | none | Optional exact HiFT phase-uniform and Gaussian values for parity tests. |
96+
| `--request-option hift_prior_noise_count=<n>` | integer | `0` | Torch RNG offset before normal HiFT source generation. |
97+
98+
The legacy GLM-TTS request keys `flow_steps`, `cfg_rate`, `flow_noise_file`,
99+
`hift_source_random_file`, and `hift_prior_noise_values` remain accepted for
100+
backward compatibility.
97101
| `--session-option glm_tts.weight_type=native|f32|f16|bf16|q8_0` | enum | `native` | Requested component weight storage type. |
98102
| `--session-option glm_tts.mem_saver=true|false` | bool | `false` | Release the reference-only Whisper-VQ and CAMPPlus runtimes after caching the voice, while keeping Llama, Flow, and HiFT warm. |
99103
| `--session-option glm_tts.aggressive_mem_saver=true|false` | bool | `false` | Also release Llama, Flow, and HiFT after each stage. This minimizes VRAM but reloads the generation path on every request. |

docs/reports/glm_tts_validation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ continue through the previous pooling graph. The regression probe
286286
`campplus_shared_default_probe` was compiled once against unmodified main and
287287
once against this branch; both emitted the same 192 serialized values.
288288

289-
The request options `flow_noise_file`, `hift_source_random_file`, and
290-
`hift_prior_noise_values` expose stochastic boundaries for targeted parity
289+
The request options `flow_noise_path`, `hift_source_random_path`, and
290+
`hift_prior_noise_count` expose stochastic boundaries for targeted parity
291291
tests without adding normal-request log spam.
292292

293293
## Normal sampled-path parity

model_specs_v1/glm_tts.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"family": "glm_tts",
33
"display_name": "GLM-TTS",
4-
"description": "Bilingual Chinese-English LLM-based TTS system with zero-shot voice cloning, streaming inference, reinforcement-learning-enhanced emotion and prosody control, and phoneme-level pronunciation control.",
4+
"description": "Community Chinese-English zero-shot speech synthesis and voice cloning with native Llama, Whisper-VQ, Flow/DiT, CAMPPlus, and HiFT execution.",
55
"category": "tts",
66
"status": "community",
77
"tasks": [
@@ -140,15 +140,15 @@
140140
"type": "int",
141141
"description": "Llama weight metadata context in MiB; default 8192.",
142142
"required": false,
143-
"min": 0,
143+
"min": 1,
144144
"default": 8192
145145
},
146146
{
147147
"name": "constant_context_mb",
148148
"type": "int",
149149
"description": "Llama constant tensor context in MiB; default 256.",
150150
"required": false,
151-
"min": 0,
151+
"min": 1,
152152
"default": 256
153153
}
154154
],
@@ -228,15 +228,16 @@
228228
"packages": [
229229
{
230230
"id": "glm_tts_q8_0",
231-
"display_name": "GLM-TTS Q8_0 GGUF",
231+
"display_name": "GLM-TTS mixed Q8_0/F16 GGUF",
232232
"default": true,
233233
"format": "gguf",
234234
"precision": "q8_0",
235-
"target_directory": "GLM-TTS-GGUF",
235+
"target_directory": "GLM-TTS-Q8",
236236
"files": [
237237
"Text to audio (TTS)/GLM-TTS_Q8.gguf"
238238
],
239239
"strip_prefix": "Text to audio (TTS)",
240+
"description": "Standalone GGUF with the autoregressive Llama tensors retained in F16 and the speech tokenizer, Flow, HiFT, and CAMPPlus tensors stored as Q8_0.",
240241
"download": {
241242
"kind": "huggingface_snapshot",
242243
"repo": "mirek190/audio.cpp"

src/community_models/glm_tts/loader.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,20 @@ runtime::ModelCliInterface cli() {
4949
"float",
5050
"Speech-token nucleus threshold; official default 0.8."},
5151
{"seed", "n", "Speech-token, Flow-noise, and HiFT seed."},
52-
{"flow_steps",
52+
{"num_inference_steps",
5353
"n",
5454
"Flow Euler steps; official default 10."},
55-
{"cfg_rate",
55+
{"flow_guidance_scale",
5656
"float",
5757
"Flow classifier-free guidance rate; official default 0.7."},
58-
{"flow_noise_file",
58+
{"flow_noise_path",
5959
"path",
6060
"Optional raw float32 initial Flow noise for parity tests."},
61-
{"hift_source_random_file",
61+
{"hift_source_random_path",
6262
"path",
6363
"Optional raw float32 HiFT phase-uniform and Gaussian values "
6464
"for parity tests."},
65-
{"hift_prior_noise_values",
65+
{"hift_prior_noise_count",
6666
"n",
6767
"Torch RNG value offset used before HiFT source generation."}};
6868
out.session_options = {

src/community_models/glm_tts/session.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,15 +451,15 @@ runtime::TaskResult GlmTTSSession::run(
451451
flow_input.speaker_embedding = reference.speaker_embedding;
452452
flow_input.inference_steps = static_cast<int>(
453453
runtime::parse_i64_option(
454-
request.options, {"flow_steps"})
454+
request.options, {"num_inference_steps", "flow_steps"})
455455
.value_or(assets_->config.flow.inference_steps));
456456
flow_input.cfg_rate = runtime::parse_finite_float_option(
457-
request.options, {"cfg_rate"})
457+
request.options, {"flow_guidance_scale", "cfg_rate"})
458458
.value_or(assets_->config.flow.inference_cfg_rate);
459459
const size_t flow_noise_count = static_cast<size_t>(
460460
flow_frames * assets_->config.flow.mel_dim);
461461
flow_input.initial_noise = optional_f32_values(
462-
request, {"flow_noise_file"}, "Flow noise");
462+
request, {"flow_noise_path", "flow_noise_file"}, "Flow noise");
463463
if (flow_input.initial_noise.empty()) {
464464
flow_input.initial_noise =
465465
normal_noise(flow_noise_count, seed + 1);
@@ -480,15 +480,16 @@ runtime::TaskResult GlmTTSSession::run(
480480
mel.mel, mel.frames, assets_->config.flow.mel_dim);
481481
const auto hift_source_random = optional_f32_values(
482482
request,
483-
{"hift_source_random_file"},
483+
{"hift_source_random_path", "hift_source_random_file"},
484484
"HiFT source-random");
485485
const auto * hift_source_random_ptr =
486486
hift_source_random.empty()
487487
? nullptr
488488
: &hift_source_random;
489489
const uint64_t hift_prior_noise_values =
490490
runtime::parse_u64_option(
491-
request.options, {"hift_prior_noise_values"})
491+
request.options,
492+
{"hift_prior_noise_count", "hift_prior_noise_values"})
492493
.value_or(0);
493494
const auto vocoder_start = Clock::now();
494495
auto waveform = hift().synthesize(

tests/glm_tts/glm_tts_warm_bench.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ std::vector<RequestCase> load_requests(
135135
"top_k",
136136
"top_p",
137137
"seed",
138-
"flow_steps",
139-
"cfg_rate"}) {
138+
"num_inference_steps",
139+
"flow_guidance_scale"}) {
140140
if (const auto * value = item.find(name);
141141
value != nullptr && !value->is_null()) {
142142
request.options[name] = scalar_option(*value);

0 commit comments

Comments
 (0)