Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
translator = pipeline("translation", model="vsrinivas/marian-finetuned-kde4-en-to-hi") | |
def translate(input): | |
output = translator(input) | |
return output['translation_text'] | |
demo = gr.Interface(fn=translate, | |
inputs=[gr.Textbox(label="English text that you want to translate into Hindi !", lines=6)], | |
outputs=[gr.Textbox(label="Translated Hindi Text !!!", lines=3)], | |
title="English to Hindi Text translation test and demo app by Srinivas.V ..", | |
description="Translates English text into Hindi text", | |
allow_flagging="never" | |
) | |
demo.launch() |