Spaces:
Runtime error
Runtime error
Update app.py
Browse filesTry the model trained by sanchit-gandhi
app.py
CHANGED
@@ -13,9 +13,11 @@ asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base",
|
|
13 |
|
14 |
# load text-to-speech checkpoint and speaker embeddings
|
15 |
#processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
16 |
-
processor = SpeechT5Processor.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_cs")
|
|
|
17 |
|
18 |
-
model = SpeechT5ForTextToSpeech.from_pretrained("
|
|
|
19 |
#model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
|
20 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
|
21 |
|
@@ -24,7 +26,7 @@ speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze
|
|
24 |
|
25 |
|
26 |
def translate(audio):
|
27 |
-
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "
|
28 |
return outputs["text"]
|
29 |
|
30 |
|
|
|
13 |
|
14 |
# load text-to-speech checkpoint and speaker embeddings
|
15 |
#processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
16 |
+
#processor = SpeechT5Processor.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_cs")
|
17 |
+
processor = SpeechT5Processor.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl")
|
18 |
|
19 |
+
model = SpeechT5ForTextToSpeech.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl").to(device)
|
20 |
+
#model = SpeechT5ForTextToSpeech.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_cs").to(device)
|
21 |
#model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
|
22 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
|
23 |
|
|
|
26 |
|
27 |
|
28 |
def translate(audio):
|
29 |
+
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "nl"})
|
30 |
return outputs["text"]
|
31 |
|
32 |
|