Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,9 +16,9 @@ asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base",
|
|
16 |
#Use own TTS Model
|
17 |
#processor = SpeechT5Processor.from_pretrained("jasonl1/speecht5_finetuned_voxpopuli_fi")
|
18 |
#processor = SpeechT5Processor.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl")
|
19 |
-
processor = SpeechT5Processor.from_pretrained("
|
20 |
|
21 |
-
model = SpeechT5ForTextToSpeech.from_pretrained("
|
22 |
|
23 |
#model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
|
24 |
#Use own TTS Model
|
@@ -40,7 +40,7 @@ speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze
|
|
40 |
# At Inference. it should use translate(sample["audio"].copy())
|
41 |
|
42 |
def translate(audio):
|
43 |
-
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "
|
44 |
return outputs["text"]
|
45 |
|
46 |
|
|
|
16 |
#Use own TTS Model
|
17 |
#processor = SpeechT5Processor.from_pretrained("jasonl1/speecht5_finetuned_voxpopuli_fi")
|
18 |
#processor = SpeechT5Processor.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl")
|
19 |
+
processor = SpeechT5Processor.from_pretrained("jason1i/speecht5_finetuned_voxpopuli_nl")
|
20 |
|
21 |
+
model = SpeechT5ForTextToSpeech.from_pretrained("jason1i/speecht5_finetuned_voxpopuli_nl")
|
22 |
|
23 |
#model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
|
24 |
#Use own TTS Model
|
|
|
40 |
# At Inference. it should use translate(sample["audio"].copy())
|
41 |
|
42 |
def translate(audio):
|
43 |
+
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "nl"})
|
44 |
return outputs["text"]
|
45 |
|
46 |
|