Spaces:
Runtime error
Runtime error
Upload gen_samples.py with huggingface_hub
Browse files- gen_samples.py +1 -1
gen_samples.py
CHANGED
|
@@ -44,7 +44,7 @@ def encode_ref(codec, wav):
|
|
| 44 |
# Squeeze batch dim: (1, num_codebooks, T) -> (num_codebooks, T)
|
| 45 |
if tokens.ndim == 3 and tokens.shape[0] == 1:
|
| 46 |
tokens = tokens.squeeze(0)
|
| 47 |
-
return tokens.detach()
|
| 48 |
|
| 49 |
def generate_clone(model, codec, ref_tokens, ref_text, gen_text, out_path):
|
| 50 |
"""Generate voice clone using the Conversation API correctly."""
|
|
|
|
| 44 |
# Squeeze batch dim: (1, num_codebooks, T) -> (num_codebooks, T)
|
| 45 |
if tokens.ndim == 3 and tokens.shape[0] == 1:
|
| 46 |
tokens = tokens.squeeze(0)
|
| 47 |
+
return tokens.detach()
|
| 48 |
|
| 49 |
def generate_clone(model, codec, ref_tokens, ref_text, gen_text, out_path):
|
| 50 |
"""Generate voice clone using the Conversation API correctly."""
|