Spaces:
Sleeping
Sleeping
firs try
Browse files
app.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
pipeline = pipeline(task="translation", model="lgrobol/m2m100_418M_br_fr")
|
| 5 |
+
|
| 6 |
+
def predict(text):
|
| 7 |
+
predictions = pipeline(text, src_lang="br", tgt_lang="fr")
|
| 8 |
+
return predictions[0]["translation_text"]
|
| 9 |
+
|
| 10 |
+
gr.Interface(
|
| 11 |
+
predict,
|
| 12 |
+
inputs=gradio.Textbox(placeholder="Entrez un texte en Breton"),
|
| 13 |
+
outputs=gradio.Textbox(),
|
| 14 |
+
title="Traduction Breton-Français",
|
| 15 |
+
).launch()
|