Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
|
12 |
asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=device)
|
13 |
|
14 |
# load text-to-speech checkpoint and speaker embeddings
|
15 |
-
model_name = "
|
16 |
processor = SpeechT5Processor.from_pretrained(model_name)
|
17 |
|
18 |
model = SpeechT5ForTextToSpeech.from_pretrained(model_name).to(device)
|
@@ -23,7 +23,7 @@ speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze
|
|
23 |
|
24 |
|
25 |
def translate(audio):
|
26 |
-
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "
|
27 |
# outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe"})
|
28 |
return outputs["text"]
|
29 |
|
|
|
12 |
asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=device)
|
13 |
|
14 |
# load text-to-speech checkpoint and speaker embeddings
|
15 |
+
model_name = "sanchit-gandhi/speecht5_tts_vox_nl"
|
16 |
processor = SpeechT5Processor.from_pretrained(model_name)
|
17 |
|
18 |
model = SpeechT5ForTextToSpeech.from_pretrained(model_name).to(device)
|
|
|
23 |
|
24 |
|
25 |
def translate(audio):
|
26 |
+
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "nl"})
|
27 |
# outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe"})
|
28 |
return outputs["text"]
|
29 |
|