Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze
|
|
25 |
translator = pipeline("translation", model="Helsinki-NLP/opus-mt-en-ru", device=device)
|
26 |
|
27 |
def translate(audio):
|
28 |
-
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "
|
29 |
translated_text = translator(outputs["text"])
|
30 |
return translated_text[0]['translation_text']
|
31 |
|
|
|
25 |
translator = pipeline("translation", model="Helsinki-NLP/opus-mt-en-ru", device=device)
|
26 |
|
27 |
def translate(audio):
|
28 |
+
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "translate"})
|
29 |
translated_text = translator(outputs["text"])
|
30 |
return translated_text[0]['translation_text']
|
31 |
|