Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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-
|
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 |
-
|
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__':
|