Spaces:
Runtime error
Runtime error
divakaivan
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -138,8 +138,10 @@ def predict(text, speaker):
|
|
138 |
### ### ###
|
139 |
example = dataset['test'][11]
|
140 |
# speaker_embedding = torch.tensor(example["speaker_embeddings"]).unsqueeze(0)
|
|
|
141 |
speaker_embedding = speaker_embedding.expand(-1, inputs["input_ids"].size(1), -1)
|
142 |
spectrogram = model.generate_speech(inputs["input_ids"].to(device), speaker_embedding)
|
|
|
143 |
# speaker_embedding = torch.tensor(speaker_embedding).unsqueeze(0)
|
144 |
# spectrogram = model.generate_speech(inputs["input_ids"], speaker_embedding)
|
145 |
with torch.no_grad():
|
|
|
138 |
### ### ###
|
139 |
example = dataset['test'][11]
|
140 |
# speaker_embedding = torch.tensor(example["speaker_embeddings"]).unsqueeze(0)
|
141 |
+
speaker_embedding = torch.tensor(example["speaker_embeddings"]).unsqueeze(0).unsqueeze(0).to(device)
|
142 |
speaker_embedding = speaker_embedding.expand(-1, inputs["input_ids"].size(1), -1)
|
143 |
spectrogram = model.generate_speech(inputs["input_ids"].to(device), speaker_embedding)
|
144 |
+
|
145 |
# speaker_embedding = torch.tensor(speaker_embedding).unsqueeze(0)
|
146 |
# spectrogram = model.generate_speech(inputs["input_ids"], speaker_embedding)
|
147 |
with torch.no_grad():
|