TekamBrice's picture
Update app.py
72cad32 verified
import gradio as gr
import transformers
import sentencepiece
from transformers import pipeline
translate=pipeline('translation',model='Helsinki-NLP/opus-mt-fr-en')
def get_translation(text):
translat=translate(text)
return translat[0]['translation_text']
interf=gr.Interface(get_translation,title='translation text to english',inputs='text',outputs='text').launch()