yaya-sy commited on
Commit
676dadb
1 Parent(s): 75a2980

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -7,7 +7,7 @@ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
7
 
8
  def load_models():
9
  # build model and tokenizer
10
- model_name_dict = {'nllb-distilled-600M': 'facebook/nllb-200-distilled-600M',
11
  #'nllb-1.3B': 'facebook/nllb-200-1.3B',
12
  #'nllb-distilled-1.3B': 'facebook/nllb-200-distilled-1.3B',
13
  #'nllb-3.3B': 'facebook/nllb-200-3.3B',
@@ -40,11 +40,7 @@ def translation(source, target, text):
40
  end_time = time.time()
41
 
42
  output = output[0]['translation_text']
43
- result = {'inference_time': end_time - start_time,
44
- 'source': source,
45
- 'target': target,
46
- 'result': output}
47
- return result
48
 
49
 
50
  if __name__ == '__main__':
 
7
 
8
  def load_models():
9
  # build model and tokenizer
10
+ model_name_dict = {'nllb-distilled-600M': 'facebook/nllb-3.3B',
11
  #'nllb-1.3B': 'facebook/nllb-200-1.3B',
12
  #'nllb-distilled-1.3B': 'facebook/nllb-200-distilled-1.3B',
13
  #'nllb-3.3B': 'facebook/nllb-200-3.3B',
 
40
  end_time = time.time()
41
 
42
  output = output[0]['translation_text']
43
+ return output
 
 
 
 
44
 
45
 
46
  if __name__ == '__main__':