Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
demo = gr.Interface(fn=
|
| 7 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from deep_translator import GoogleTranslator
|
| 3 |
|
| 4 |
+
def translate(input_text):
|
| 5 |
+
translated = GoogleTranslator(source='auto', target='fa').translate(input_text)
|
| 6 |
+
return translated
|
| 7 |
|
| 8 |
+
demo = gr.Interface(fn=translate, inputs="text", outputs="text")
|
| 9 |
demo.launch()
|