Spaces:
Runtime error
Runtime error
File size: 601 Bytes
fb39d4f c10da08 fb39d4f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
from transformers import pipeline
generate=pipeline("translation_en_to_fr",model="LawalAfeez/en-fr-translation")
import gradio as gr
title=""" <hi> Here to convert your English text to French</h1>"""
description="""<h5> This demo app is for english french language translation</h5>"""
def en_fr(english_text):
fr=generate(english_text)
translation=fr[0]["translation_text"]
return translation
demo =gr.Interface(fn=en_fr,inputs=gr.Textbox(label="English version"),outputs=gr.Textbox(label="French version"),title=title,description=description)
if __name__ =="__main__":
demo.launch() |