Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -43,14 +43,24 @@ def classify_task2(prompt):
|
|
43 |
return 'Unknown Task'
|
44 |
|
45 |
# Create the Gradio interface
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
# Launch the app
|
55 |
if __name__ == "__main__":
|
56 |
-
|
|
|
43 |
return 'Unknown Task'
|
44 |
|
45 |
# Create the Gradio interface
|
46 |
+
with gr.Blocks() as demo:
|
47 |
+
gr.HTML("""
|
48 |
+
<center><h1>Emoji Translator 🤗😻</h1>
|
49 |
+
<h3>Translate any text into emojis, and vice versa!</h3>
|
50 |
+
</center>
|
51 |
+
""")
|
52 |
+
|
53 |
+
gr.Markdown("""
|
54 |
+
# Text to Emoji 📖➡️😻
|
55 |
+
""")
|
56 |
+
with gr.Row():
|
57 |
+
text_uesr_input = gr.Textbox(label="Enter text 📚")
|
58 |
+
output = gr.Textbox(label="Translation")
|
59 |
+
with gr.Row():
|
60 |
+
translate_btn = gr.Button("Translate 🚀")
|
61 |
+
translate_btn.click(fn=classify_task, inputs=text_uesr_input,
|
62 |
+
outputs=output, api_name="translate_text")
|
63 |
|
64 |
# Launch the app
|
65 |
if __name__ == "__main__":
|
66 |
+
demo.launch()
|