Spaces:
Runtime error
Runtime error
Add examples
Browse files- __pycache__/ui.cpython-310.pyc +0 -0
- app.py +2 -2
- ui.py +5 -2
__pycache__/ui.cpython-310.pyc
CHANGED
Binary files a/__pycache__/ui.cpython-310.pyc and b/__pycache__/ui.cpython-310.pyc differ
|
|
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
3 |
import torch
|
4 |
-
from ui import title, description
|
5 |
from langs import LANGS
|
6 |
|
7 |
TASK = "translation"
|
@@ -37,7 +37,7 @@ gr.Interface(
|
|
37 |
gr.inputs.Slider(8,512, default=400, step=8, label="Max Length")
|
38 |
],
|
39 |
["text"],
|
40 |
-
|
41 |
# article=article,
|
42 |
cache_examples=False,
|
43 |
title=title,
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
3 |
import torch
|
4 |
+
from ui import title, description, examples
|
5 |
from langs import LANGS
|
6 |
|
7 |
TASK = "translation"
|
|
|
37 |
gr.inputs.Slider(8,512, default=400, step=8, label="Max Length")
|
38 |
],
|
39 |
["text"],
|
40 |
+
examples=examples,
|
41 |
# article=article,
|
42 |
cache_examples=False,
|
43 |
title=title,
|
ui.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
title = "NLLB Demo"
|
2 |
description = """
|
3 |
<p>
|
4 |
<center>
|
@@ -7,4 +7,7 @@ Developed by <a href='https://www.narrativa.com/'>Narrativa</a>.
|
|
7 |
<img src="https://raw.githubusercontent.com/facebookresearch/fairseq/nllb/nllb.png" alt="meta nllb pic" width="700"/>
|
8 |
</center>
|
9 |
</p>
|
10 |
-
"""
|
|
|
|
|
|
|
|
1 |
+
title = "NLLB TRANSLATION Demo"
|
2 |
description = """
|
3 |
<p>
|
4 |
<center>
|
|
|
7 |
<img src="https://raw.githubusercontent.com/facebookresearch/fairseq/nllb/nllb.png" alt="meta nllb pic" width="700"/>
|
8 |
</center>
|
9 |
</p>
|
10 |
+
"""
|
11 |
+
|
12 |
+
examples = [["I love to test latest translation models by META at HuggingFace thanks to Narrativa",
|
13 |
+
"eng_Latn", "spa_Latn", 400]]
|