File size: 430 Bytes
8095f88
84cec7f
8b419c8
84cec7f
1d971c3
14e381d
 
84cec7f
8b419c8
84cec7f
 
14e381d
84cec7f
 
 
 
8b419c8
 
84cec7f
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from googletrans import Translator

translator = Translator()

def translate_text(text):
    translation = translator.translate(text, dest="en")
    return translation.text

gradio_interface = gr.Interface(
    fn=translate_text,
    inputs="text",
    outputs="text",
    title="Google Translate",
    description="Translate text using Google Translate API",
    theme="default"
)

gradio_interface.launch()