lgrobol commited on
Commit
bbda808
1 Parent(s): dc968c3
Files changed (1) hide show
  1. app.py +15 -0
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()