Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -29,25 +29,26 @@ def get_top_emojis(text, tokenizer, model, top_n=TOP_N):
|
|
29 |
cur_model_name = DEFAULT_MODEL
|
30 |
print("cur_model", cur_model_name)
|
31 |
|
32 |
-
tokenizer = AutoTokenizer.from_pretrained(cur_model_name)
|
33 |
-
model = AutoModelForSequenceClassification.from_pretrained(cur_model_name)
|
34 |
-
|
35 |
-
st.set_page_config( # Alternate names: setup_page, page, layout
|
36 |
-
layout="centered", # Can be "centered" or "wide". In the future also "dashboard", etc.
|
37 |
-
initial_sidebar_state="auto", # Can be "auto", "expanded", "collapsed"
|
38 |
-
page_title="Emoji-motion!", # String or None. Strings get appended with "• Streamlit".
|
39 |
-
page_icon=None, # String, anything supported by st.image, or None.
|
40 |
-
)
|
41 |
-
|
42 |
-
st.title('Emoji-motion!')
|
43 |
-
|
44 |
-
example_prompts = [
|
45 |
-
"Today is going to be awesome!",
|
46 |
-
"Pity those who don't feel anything at all.",
|
47 |
-
"I envy people that know love.",
|
48 |
-
"Nature is so beautiful"]
|
49 |
-
|
50 |
def main():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
example = st.selectbox("Choose an example", example_prompts)
|
52 |
|
53 |
# Take the message which needs to be processed
|
|
|
29 |
cur_model_name = DEFAULT_MODEL
|
30 |
print("cur_model", cur_model_name)
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
def main():
|
33 |
+
tokenizer = AutoTokenizer.from_pretrained(cur_model_name)
|
34 |
+
model = AutoModelForSequenceClassification.from_pretrained(cur_model_name)
|
35 |
+
|
36 |
+
st.set_page_config( # Alternate names: setup_page, page, layout
|
37 |
+
layout="centered", # Can be "centered" or "wide". In the future also "dashboard", etc.
|
38 |
+
initial_sidebar_state="auto", # Can be "auto", "expanded", "collapsed"
|
39 |
+
page_title="Emoji-motion!", # String or None. Strings get appended with "• Streamlit".
|
40 |
+
page_icon=None, # String, anything supported by st.image, or None.
|
41 |
+
)
|
42 |
+
|
43 |
+
st.title('Emoji-motion!')
|
44 |
+
|
45 |
+
example_prompts = [
|
46 |
+
"Today is going to be awesome!",
|
47 |
+
"Pity those who don't feel anything at all.",
|
48 |
+
"I envy people that know love.",
|
49 |
+
"Nature is so beautiful"]
|
50 |
+
|
51 |
+
|
52 |
example = st.selectbox("Choose an example", example_prompts)
|
53 |
|
54 |
# Take the message which needs to be processed
|