Traduction / app.py
SerenaTOUM's picture
Create app.py
9aad3f0 verified
raw
history blame contribute delete
440 Bytes
import sentencepiece
from transformers import pipeline
translator = pipeline("translation",model="Helsinki-NLP/opus-mt-fr-en")
import gradio as gr
def translation (text):
traduction = translator(text)
return traduction[0]["translation_text"]
demo = gr.Interface(translation, title= "TRADUCTION", inputs = "text", outputs = "text", description = "Traduisons ce texte du français vers l'anglais ! Allons y")
demo.launch(quiet = True)