Spaces:
Runtime error
Runtime error
Commit
·
f2ab8af
1
Parent(s):
3307166
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import json
|
3 |
+
|
4 |
+
with open("emoji_meanings.json", "r", encoding="utf-8") as json_file:
|
5 |
+
emoji_meanings = json.load(json_file)
|
6 |
+
|
7 |
+
def get_emoji_meaning(emoji):
|
8 |
+
return emoji_meanings.get(emoji, "Emoticon meaning not found")
|
9 |
+
|
10 |
+
iface = gr.Interface(
|
11 |
+
fn=get_emoji_meaning,
|
12 |
+
inputs=gr.Textbox(label="Emoji Input", max_lines=1, interactive=True),
|
13 |
+
outputs=gr.Textbox(label="Emoji Meaning", max_lines=2, lines=1, show_copy_button=True, interactive=False)
|
14 |
+
title="Emoji Meaning",
|
15 |
+
theme="zenafey/prodia-web",
|
16 |
+
live=True,
|
17 |
+
)
|
18 |
+
|
19 |
+
iface.launch(show_api=False)
|