Spaces:
Runtime error
Runtime error
FIX: Emoji color
Browse files
app.py
CHANGED
@@ -52,7 +52,7 @@ def main():
|
|
52 |
new_text.append(t)
|
53 |
return " ".join(new_text)
|
54 |
|
55 |
-
@st.cache(allow_output_mutation=True, suppress_st_warning=True, show_spinner=
|
56 |
def load_model():
|
57 |
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
|
58 |
model = AutoModelForSequenceClassification.from_pretrained(BASE_MODEL)
|
@@ -73,7 +73,18 @@ def main():
|
|
73 |
# Define function to run when submit is clicked
|
74 |
def submit(message):
|
75 |
if len(message) > 0:
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
else:
|
78 |
st.error("The text can't be empty")
|
79 |
|
|
|
52 |
new_text.append(t)
|
53 |
return " ".join(new_text)
|
54 |
|
55 |
+
@st.cache(allow_output_mutation=True, suppress_st_warning=True, show_spinner=True)
|
56 |
def load_model():
|
57 |
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
|
58 |
model = AutoModelForSequenceClassification.from_pretrained(BASE_MODEL)
|
|
|
73 |
# Define function to run when submit is clicked
|
74 |
def submit(message):
|
75 |
if len(message) > 0:
|
76 |
+
emoji = get_top_emojis(message)
|
77 |
+
html_str = f"""
|
78 |
+
<style>
|
79 |
+
p.a {{
|
80 |
+
font: 26px Courier;
|
81 |
+
}}
|
82 |
+
</style>
|
83 |
+
<p class="a">{emoji}</p>
|
84 |
+
"""
|
85 |
+
|
86 |
+
st.markdown(html_str, unsafe_allow_html=True)
|
87 |
+
# st.markdown(emoji)
|
88 |
else:
|
89 |
st.error("The text can't be empty")
|
90 |
|