Spaces:
Runtime error
Runtime error
geonmo.gu
commited on
Commit
·
5cc416b
1
Parent(s):
3d1d83f
support only 600M model
Browse files
app.py
CHANGED
|
@@ -9,8 +9,8 @@ from flores200_codes import flores_codes
|
|
| 9 |
def load_models():
|
| 10 |
# build model and tokenizer
|
| 11 |
model_name_dict = {'nllb-distilled-600M': 'facebook/nllb-200-distilled-600M',
|
| 12 |
-
'nllb-1.3B': 'facebook/nllb-200-1.3B',
|
| 13 |
-
'nllb-distilled-1.3B': 'facebook/nllb-200-distilled-1.3B',
|
| 14 |
#'nllb-3.3B': 'facebook/nllb-200-3.3B',
|
| 15 |
}
|
| 16 |
|
|
@@ -56,20 +56,20 @@ if __name__ == '__main__':
|
|
| 56 |
|
| 57 |
# define gradio demo
|
| 58 |
lang_codes = list(flores_codes.keys())
|
| 59 |
-
inputs = [gr.inputs.Radio(['nllb-distilled-600M', 'nllb-1.3B', 'nllb-distilled-1.3B'], label='NLLB Model'),
|
| 60 |
-
|
| 61 |
gr.inputs.Dropdown(lang_codes, label='Target'),
|
| 62 |
gr.inputs.Textbox(lines=5, label="Input text"),
|
| 63 |
]
|
| 64 |
|
| 65 |
outputs = gr.outputs.JSON()
|
| 66 |
|
| 67 |
-
title = "NLLB demo"
|
| 68 |
|
| 69 |
demo_status = "Demo is running on CPU"
|
| 70 |
description = f"Details: https://github.com/facebookresearch/fairseq/tree/nllb. {demo_status}"
|
| 71 |
examples = [
|
| 72 |
-
['
|
| 73 |
]
|
| 74 |
|
| 75 |
gr.Interface(translation,
|
|
|
|
| 9 |
def load_models():
|
| 10 |
# build model and tokenizer
|
| 11 |
model_name_dict = {'nllb-distilled-600M': 'facebook/nllb-200-distilled-600M',
|
| 12 |
+
#'nllb-1.3B': 'facebook/nllb-200-1.3B',
|
| 13 |
+
#'nllb-distilled-1.3B': 'facebook/nllb-200-distilled-1.3B',
|
| 14 |
#'nllb-3.3B': 'facebook/nllb-200-3.3B',
|
| 15 |
}
|
| 16 |
|
|
|
|
| 56 |
|
| 57 |
# define gradio demo
|
| 58 |
lang_codes = list(flores_codes.keys())
|
| 59 |
+
#inputs = [gr.inputs.Radio(['nllb-distilled-600M', 'nllb-1.3B', 'nllb-distilled-1.3B'], label='NLLB Model'),
|
| 60 |
+
inputs = [gr.inputs.Dropdown(lang_codes, label='Source'),
|
| 61 |
gr.inputs.Dropdown(lang_codes, label='Target'),
|
| 62 |
gr.inputs.Textbox(lines=5, label="Input text"),
|
| 63 |
]
|
| 64 |
|
| 65 |
outputs = gr.outputs.JSON()
|
| 66 |
|
| 67 |
+
title = "NLLB distilled 600M demo"
|
| 68 |
|
| 69 |
demo_status = "Demo is running on CPU"
|
| 70 |
description = f"Details: https://github.com/facebookresearch/fairseq/tree/nllb. {demo_status}"
|
| 71 |
examples = [
|
| 72 |
+
['English', 'Korean', 'Hi. nice to meet you']
|
| 73 |
]
|
| 74 |
|
| 75 |
gr.Interface(translation,
|