preetam8 commited on
Commit
bc20e42
·
1 Parent(s): 472a003
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -26,7 +26,7 @@ def translate(audio):
26
  outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "translate"})
27
  eng_text = outputs["text"]
28
  encoded_eng_text = translation_tokenizer(eng_text, return_tensors="pt")
29
- generated_tokens = translation_model(**encoded_eng_text)
30
  return translation_tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
31
 
32
 
 
26
  outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "translate"})
27
  eng_text = outputs["text"]
28
  encoded_eng_text = translation_tokenizer(eng_text, return_tensors="pt")
29
+ generated_tokens = translation_model.generate(**encoded_eng_text)
30
  return translation_tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
31
 
32