Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,13 +3,13 @@ from transformers import pipeline
|
|
3 |
|
4 |
pipeline = pipeline(task="translation", model="lgrobol/m2m100_418M_br_fr")
|
5 |
|
6 |
-
def predict(
|
7 |
-
predictions = pipeline(text, src_lang="br", tgt_lang="fr")
|
8 |
-
return
|
9 |
|
10 |
gr.Interface(
|
11 |
predict,
|
12 |
-
inputs=gr.Textbox(placeholder="Entrez
|
13 |
-
outputs=gr.Textbox(),
|
14 |
title="Traduction Breton-Français",
|
15 |
).launch()
|
|
|
3 |
|
4 |
pipeline = pipeline(task="translation", model="lgrobol/m2m100_418M_br_fr")
|
5 |
|
6 |
+
def predict(texts):
|
7 |
+
predictions = pipeline(text.splitlines(), src_lang="br", tgt_lang="fr")
|
8 |
+
return "\n".join(p["translation_text"] for p in predictions)
|
9 |
|
10 |
gr.Interface(
|
11 |
predict,
|
12 |
+
inputs=gr.Textbox(label="Breton", placeholder="Entrez des phrases en Breton. Une phrase par ligne, une ligne par phrase."),
|
13 |
+
outputs=gr.Textbox(label="Français"),
|
14 |
title="Traduction Breton-Français",
|
15 |
).launch()
|