Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from googletrans import Translator
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
translator = Translator()
|
| 5 |
+
|
| 6 |
+
def translation(text):
|
| 7 |
+
translation = translator.translate(text)
|
| 8 |
+
res=translation.text
|
| 9 |
+
return res
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
inp_text = gr.inputs.Textbox(label='Input')
|
| 13 |
+
output = gr.outputs.Textbox(label='Output')
|
| 14 |
+
|
| 15 |
+
gr.Interface(fn=translation, inputs=inp_text, outputs=output, title='Translation',theme='peach').launch(debug=True)
|
| 16 |
+
|
| 17 |
+
|