Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -27,6 +27,7 @@ speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze
|
|
27 |
|
28 |
def translate(audio):
|
29 |
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "nl"})
|
|
|
30 |
return outputs["text"][:600]
|
31 |
|
32 |
|
@@ -39,7 +40,6 @@ def synthesise(text):
|
|
39 |
def speech_to_speech_translation(audio):
|
40 |
translated_text = translate(audio)
|
41 |
synthesised_speech = synthesise(translated_text)
|
42 |
-
synthesised_speech = synthesised_speech[:1800]
|
43 |
synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
|
44 |
return 16000, synthesised_speech
|
45 |
|
|
|
27 |
|
28 |
def translate(audio):
|
29 |
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "nl"})
|
30 |
+
print ("Translated text", outputs["text"][:600])
|
31 |
return outputs["text"][:600]
|
32 |
|
33 |
|
|
|
40 |
def speech_to_speech_translation(audio):
|
41 |
translated_text = translate(audio)
|
42 |
synthesised_speech = synthesise(translated_text)
|
|
|
43 |
synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
|
44 |
return 16000, synthesised_speech
|
45 |
|