File size: 432 Bytes
bbda808
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr
from transformers import pipeline

pipeline = pipeline(task="translation", model="lgrobol/m2m100_418M_br_fr")

def predict(text):
  predictions = pipeline(text, src_lang="br", tgt_lang="fr")
  return predictions[0]["translation_text"]

gr.Interface(
    predict,
    inputs=gradio.Textbox(placeholder="Entrez un texte en Breton"),
    outputs=gradio.Textbox(),
    title="Traduction Breton-Français",
).launch()