Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,7 @@ def get_top_emojis(text, tokenizer, model, top_n=TOP_N):
|
|
26 |
|
27 |
def main():
|
28 |
|
|
|
29 |
st.set_page_config( # Alternate names: setup_page, page, layout
|
30 |
layout="centered", # Can be "centered" or "wide". In the future also "dashboard", etc.
|
31 |
initial_sidebar_state="auto", # Can be "auto", "expanded", "collapsed"
|
@@ -53,8 +54,7 @@ def main():
|
|
53 |
|
54 |
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
|
55 |
model = AutoModelForSequenceClassification.from_pretrained(BASE_MODEL)
|
56 |
-
|
57 |
-
|
58 |
# Define function to run when submit is clicked
|
59 |
def submit(message):
|
60 |
if len(message) > 0:
|
@@ -63,7 +63,7 @@ def main():
|
|
63 |
st.error("The text can't be empty")
|
64 |
|
65 |
# Run algo when submit button is clicked
|
66 |
-
if
|
67 |
submit(message)
|
68 |
|
69 |
st.text('')
|
|
|
26 |
|
27 |
def main():
|
28 |
|
29 |
+
|
30 |
st.set_page_config( # Alternate names: setup_page, page, layout
|
31 |
layout="centered", # Can be "centered" or "wide". In the future also "dashboard", etc.
|
32 |
initial_sidebar_state="auto", # Can be "auto", "expanded", "collapsed"
|
|
|
54 |
|
55 |
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
|
56 |
model = AutoModelForSequenceClassification.from_pretrained(BASE_MODEL)
|
57 |
+
|
|
|
58 |
# Define function to run when submit is clicked
|
59 |
def submit(message):
|
60 |
if len(message) > 0:
|
|
|
63 |
st.error("The text can't be empty")
|
64 |
|
65 |
# Run algo when submit button is clicked
|
66 |
+
if st.button('Submit'):
|
67 |
submit(message)
|
68 |
|
69 |
st.text('')
|