Spaces:
Runtime error
Runtime error
Update app.py
Browse filesChange language to Spanish
app.py
CHANGED
@@ -20,11 +20,11 @@ asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base",
|
|
20 |
|
21 |
|
22 |
#processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
23 |
-
processor = SpeechT5Processor.from_pretrained("kfahn/
|
24 |
#processor = SpeechT5Processor.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl")
|
25 |
|
26 |
#model = SpeechT5ForTextToSpeech.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl").to(device)
|
27 |
-
model = SpeechT5ForTextToSpeech.from_pretrained("kfahn/
|
28 |
#model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
|
29 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
|
30 |
|
@@ -33,7 +33,7 @@ speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze
|
|
33 |
|
34 |
|
35 |
def translate(audio):
|
36 |
-
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "
|
37 |
return outputs["text"]
|
38 |
|
39 |
|
|
|
20 |
|
21 |
|
22 |
#processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
23 |
+
processor = SpeechT5Processor.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_es")
|
24 |
#processor = SpeechT5Processor.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl")
|
25 |
|
26 |
#model = SpeechT5ForTextToSpeech.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl").to(device)
|
27 |
+
model = SpeechT5ForTextToSpeech.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_es").to(device)
|
28 |
#model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
|
29 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
|
30 |
|
|
|
33 |
|
34 |
|
35 |
def translate(audio):
|
36 |
+
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "es"})
|
37 |
return outputs["text"]
|
38 |
|
39 |
|