jerrybwang
commited on
Commit
Β·
ba70a88
1
Parent(s):
c1ad000
11
Browse files
app.py
CHANGED
|
@@ -18,10 +18,9 @@ def text_to_speech(text, processor, model, vocoder):
|
|
| 18 |
# Process the input text
|
| 19 |
inputs = processor(text=text, return_tensors="pt")
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)
|
| 25 |
|
| 26 |
# Generate speech using the correct method
|
| 27 |
with torch.no_grad():
|
|
|
|
| 18 |
# Process the input text
|
| 19 |
inputs = processor(text=text, return_tensors="pt")
|
| 20 |
|
| 21 |
+
# Create a simple default speaker embedding (zeros vector)
|
| 22 |
+
# This is a fallback when specific speaker embeddings are not available
|
| 23 |
+
speaker_embeddings = torch.zeros((1, 512)) # Standard speaker embedding size
|
|
|
|
| 24 |
|
| 25 |
# Generate speech using the correct method
|
| 26 |
with torch.no_grad():
|