Varosa commited on
Commit
2bb196b
1 Parent(s): d299dc7

update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -16,6 +16,9 @@ pipe = pipeline(
16
  device='cpu',
17
  )
18
 
 
 
 
19
  lang_list = list(lang_ids.keys())
20
 
21
  def translate_audio(inputs,target_language):
@@ -30,9 +33,6 @@ def translate_audio(inputs,target_language):
30
  return text
31
 
32
  else:
33
- model = MBartForConditionalGeneration.from_pretrained("sanjitaa/mbart-many-to-many")
34
- tokenizer = MBart50TokenizerFast.from_pretrained("sanjitaa/mbart-many-to-many")
35
-
36
  tokenizer.src_lang = "en_XX"
37
  chunks = nltk.tokenize.sent_tokenize(text)
38
  translated_text = ''
 
16
  device='cpu',
17
  )
18
 
19
+ model = MBartForConditionalGeneration.from_pretrained("sanjitaa/mbart-many-to-many")
20
+ tokenizer = MBart50TokenizerFast.from_pretrained("sanjitaa/mbart-many-to-many")
21
+
22
  lang_list = list(lang_ids.keys())
23
 
24
  def translate_audio(inputs,target_language):
 
33
  return text
34
 
35
  else:
 
 
 
36
  tokenizer.src_lang = "en_XX"
37
  chunks = nltk.tokenize.sent_tokenize(text)
38
  translated_text = ''