voidful commited on
Commit
4c2c5bc
·
verified ·
1 Parent(s): 6f7cab9

Document fixed Speaker B embedding

Browse files
Files changed (1) hide show
  1. README.md +43 -2
README.md CHANGED
@@ -58,8 +58,7 @@ audio = model.generate(
58
  speaker_centroid=reference_embedding,
59
  cfg_value=2.0,
60
  inference_timesteps=10,
61
- retry_badcase=True,
62
- retry_badcase_ratio_threshold=6.0,
63
  stop_threshold=0.65,
64
  stop_consecutive=2,
65
  )
@@ -82,6 +81,48 @@ offline evaluation default of `stop_threshold=0.65` and
82
  `stop_consecutive=2`. Neither policy uses retry selection or best-of-N
83
  reranking in its standard path.
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  ## Conditioning Modes
86
 
87
  ```python
 
58
  speaker_centroid=reference_embedding,
59
  cfg_value=2.0,
60
  inference_timesteps=10,
61
+ retry_badcase=False,
 
62
  stop_threshold=0.65,
63
  stop_consecutive=2,
64
  )
 
81
  `stop_consecutive=2`. Neither policy uses retry selection or best-of-N
82
  reranking in its standard path.
83
 
84
+ ## Hosted Speaker B Embedding
85
+
86
+ The hosted Space keeps Speaker A as the default and loads its fixed Speaker B
87
+ voice from `checkpoints/speaker_b_embedding.pt`. The artifact is a 192-dimensional,
88
+ L2-normalized embedding extracted from the clean Speaker B reference set. Its
89
+ payload uses the `bluemagpie-speaker-embedding-v1` format and includes
90
+ `speaker_id="female_voice"`, `generation_seed=56789`, and the Space runtime
91
+ profile `speaker_projector_scale=1.125`.
92
+
93
+ The deployed Space pins model revision
94
+ `6f7cab914a1e27c56b504ec663c0144dc25cc0a3` and validates the embedding SHA-256
95
+ `e9556e14723c140985a104c1659d1ff8a5078d2fa28ce2fb756f04906641a8a7` at
96
+ startup. Each text chunk is generated exactly once with `retry_badcase=False`;
97
+ the request path does not run ASR, speaker verification, candidate reranking,
98
+ or output-validation retries.
99
+
100
+ ```python
101
+ import os
102
+ import torch
103
+
104
+ payload = torch.load(
105
+ os.path.join(model_dir, "checkpoints", "speaker_b_embedding.pt"),
106
+ map_location="cpu",
107
+ weights_only=True,
108
+ )
109
+ speaker_b = torch.nn.functional.normalize(payload["embedding"].float(), dim=0)
110
+
111
+ audio = model.generate(
112
+ target_text="今天的會議改到下午三點。",
113
+ speaker_centroid=speaker_b,
114
+ cfg_value=2.0,
115
+ inference_timesteps=10,
116
+ retry_badcase=False,
117
+ stop_threshold=0.65,
118
+ stop_consecutive=2,
119
+ )
120
+ ```
121
+
122
+ `generation_seed` and `speaker_projector_scale` are metadata for the hosted
123
+ Space's fixed Speaker B runtime profile; `speaker_projector_scale` is not a
124
+ public `generate()` keyword argument.
125
+
126
  ## Conditioning Modes
127
 
128
  ```python