Fix bugs in translating to Dutch
Browse files
app.py
CHANGED
@@ -23,7 +23,9 @@ speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze
|
|
23 |
|
24 |
|
25 |
def translate(audio):
|
26 |
-
|
|
|
|
|
27 |
return outputs["text"]
|
28 |
|
29 |
|
|
|
23 |
|
24 |
|
25 |
def translate(audio):
|
26 |
+
# Trick Whisper to translate from any language to Dutch.
|
27 |
+
# Note that using task='translate' will translate to English instead.
|
28 |
+
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "dutch"})
|
29 |
return outputs["text"]
|
30 |
|
31 |
|