Translator / app.py
pallabi's picture
Update app.py
45e4520 verified
raw
history blame
353 Bytes
import gradio as gr
from transformers import pipeline
translation = pipeline('translation_en_to_fr')
def translate(from_text):
result = translation(from_text)[0]['translation_text']
return result
interface = gr.Interface(fn = translate , inputs = gr.Textbox(lines=2 , placeholder="text to translate") , outputs="text" )
interface.launch()