jerrybwang commited on
Commit
ba70a88
Β·
1 Parent(s): c1ad000
Files changed (1) hide show
  1. app.py +3 -4
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
- # Load speaker embeddings (use a default speaker)
22
- from datasets import load_dataset
23
- embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
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():