Update app.py
Browse files
app.py
CHANGED
@@ -15,8 +15,8 @@ asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base",
|
|
15 |
#processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
16 |
#model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
|
17 |
|
18 |
-
processor = AutoProcessor.from_pretrained("
|
19 |
-
model = SpeechT5ForTextToSpeech.from_pretrained("
|
20 |
|
21 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
|
22 |
|
@@ -25,7 +25,7 @@ speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze
|
|
25 |
|
26 |
|
27 |
def translate(audio):
|
28 |
-
outputs = asr_pipe(audio, max_new_tokens=
|
29 |
return outputs["text"]
|
30 |
|
31 |
|
|
|
15 |
#processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
16 |
#model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
|
17 |
|
18 |
+
processor = AutoProcessor.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_es")
|
19 |
+
model = SpeechT5ForTextToSpeech.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_es").to(device)
|
20 |
|
21 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
|
22 |
|
|
|
25 |
|
26 |
|
27 |
def translate(audio):
|
28 |
+
outputs = asr_pipe(audio, max_new_tokens=128, generate_kwargs={"task": "transcribe", "language": "es"})
|
29 |
return outputs["text"]
|
30 |
|
31 |
|