Spaces:
Runtime error
Runtime error
Commit
•
9f5329c
1
Parent(s):
cf13029
Update app.py
Browse files
app.py
CHANGED
@@ -64,21 +64,21 @@ def synthesise(text):
|
|
64 |
model_tts = SpeechT5ForTextToSpeech.from_pretrained("crowbarmassage/speecht5_finetuned_voxpopuli_fr")
|
65 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
|
66 |
|
67 |
-
|
68 |
-
|
69 |
|
70 |
|
71 |
# Load your dataset from Hugging Face
|
72 |
-
embeddings_dataset = load_dataset("crowbarmassage/MAEmbed")
|
73 |
-
print(embeddings_dataset.features)
|
74 |
-
print(embeddings_dataset[0])
|
75 |
|
76 |
# Extract the embedding (assuming it's in a column named 'embedding')
|
77 |
# Note: Adjust the index [0] if your embedding is at a different position in the dataset.
|
78 |
-
embedding_array = embeddings_dataset[0]['embedding']
|
79 |
|
80 |
# Convert the embedding to a PyTorch tensor and add a batch dimension
|
81 |
-
speaker_embeddings = torch.tensor(embedding_array).unsqueeze(0)
|
82 |
|
83 |
inputs = processor_tts(text=text, return_tensors="pt")
|
84 |
speech = model_tts.generate_speech(
|
|
|
64 |
model_tts = SpeechT5ForTextToSpeech.from_pretrained("crowbarmassage/speecht5_finetuned_voxpopuli_fr")
|
65 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
|
66 |
|
67 |
+
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
68 |
+
speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)
|
69 |
|
70 |
|
71 |
# Load your dataset from Hugging Face
|
72 |
+
#embeddings_dataset = load_dataset("crowbarmassage/MAEmbed")
|
73 |
+
#print(embeddings_dataset.features)
|
74 |
+
#print(embeddings_dataset[0])
|
75 |
|
76 |
# Extract the embedding (assuming it's in a column named 'embedding')
|
77 |
# Note: Adjust the index [0] if your embedding is at a different position in the dataset.
|
78 |
+
#embedding_array = embeddings_dataset[0]['embedding']
|
79 |
|
80 |
# Convert the embedding to a PyTorch tensor and add a batch dimension
|
81 |
+
#speaker_embeddings = torch.tensor(embedding_array).unsqueeze(0)
|
82 |
|
83 |
inputs = processor_tts(text=text, return_tensors="pt")
|
84 |
speech = model_tts.generate_speech(
|