troer / app.py
lgrobol's picture
Update app.py
b7f051a
raw
history blame
No virus
685 Bytes
import gradio as gr
from transformers import pipeline
pipeline = pipeline(task="translation", model="lgrobol/m2m100_418M_br_fr")
def predict(texts):
predictions = pipeline(texts.splitlines(), src_lang="br", tgt_lang="fr")
return "\n".join(p["translation_text"] for p in predictions)
gr.Interface(
predict,
inputs=gr.Textbox(label="Breton", placeholder="Entrez des phrases en Breton. Une phrase par ligne, une ligne par phrase."),
outputs=gr.Textbox(label="Français"),
title="Traduction Breton-Français",
article="Cette interface utilse le modèle de traduction automatique [m2m100_418M_br_fr](https://huggingface.co./lgrobol/m2m100_418M_br_fr).",
).launch()