NadiaHolmlund's picture
Update app.py
84cec7f
raw
history blame
464 Bytes
import gradio as gr
from googletrans import Translator
translator = Translator()
def translate_text(text, dest_language):
translation = translator.translate(text, dest=dest_language)
return translation.text
gradio_interface = gr.Interface(
fn=translate_text,
inputs=["text", "text"],
outputs="text",
title="Google Translate",
description="Translate text using Google Translate API",
theme="default"
)
gradio_interface.launch()