taohoang commited on
Commit
ece2678
1 Parent(s): a81a2a5

Fix bugs in translating to Dutch

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -23,7 +23,9 @@ 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": "translate", "language": "dutch"})
 
 
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