eskayML's picture
Create app.py
374bf86
Raw
History Blame Contribute Delete
338 Bytes
from transformers import pipeline
translator = pipeline('translation_en_to_fr')
tran_fun = lambda x: translator(x)[0]['translation_text']
import gradio as gr
demo = gr.Interface(
fn = tran_fun,
inputs = gr.Textbox(label = 'Enter An English Word to be translated into French', lines = 3),
outputs = 'text',
)
demo.launch()