OMGJ's picture
Create app.py
e792481 verified
raw
history blame contribute delete
435 Bytes
import transformers
from transformers import pipeline
import gradio as gr
translator = pipeline("translation" , model='Helsinki-NLP/opus-mt-fr-en')
result = translator('J\'irai à l\'eglise')
result[0]['translation_text']
def translate(input):
result = translator(input)
return result[0]['translation_text']
translation_interface = gr.Interface(fn=translate, inputs='text',outputs='text')
translation_interface.launch(share=True)