Spaces:
Runtime error
Runtime error
NadiaHolmlund
commited on
Commit
·
14e381d
1
Parent(s):
84cec7f
Update app.py
Browse files
app.py
CHANGED
@@ -3,13 +3,13 @@ from googletrans import Translator
|
|
3 |
|
4 |
translator = Translator()
|
5 |
|
6 |
-
def translate_text(text
|
7 |
-
translation = translator.translate(text, dest=
|
8 |
return translation.text
|
9 |
|
10 |
gradio_interface = gr.Interface(
|
11 |
fn=translate_text,
|
12 |
-
inputs=
|
13 |
outputs="text",
|
14 |
title="Google Translate",
|
15 |
description="Translate text using Google Translate API",
|
|
|
3 |
|
4 |
translator = Translator()
|
5 |
|
6 |
+
def translate_text(text):
|
7 |
+
translation = translator.translate(text, dest="en")
|
8 |
return translation.text
|
9 |
|
10 |
gradio_interface = gr.Interface(
|
11 |
fn=translate_text,
|
12 |
+
inputs="text",
|
13 |
outputs="text",
|
14 |
title="Google Translate",
|
15 |
description="Translate text using Google Translate API",
|