Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ def preprocess(text):
|
|
14 |
return " ".join(new_text)
|
15 |
|
16 |
|
17 |
-
def get_top_emojis(text, tokenizer, top_n=TOP_N):
|
18 |
preprocessed = preprocess(text)
|
19 |
inputs = tokenizer(preprocessed, return_tensors="pt")
|
20 |
preds = model(**inputs).logits
|
@@ -58,7 +58,7 @@ def main():
|
|
58 |
# Define function to run when submit is clicked
|
59 |
def submit(message):
|
60 |
if len(message) > 0:
|
61 |
-
st.header(get_top_emojis(message, tokenizer=tokenizer))
|
62 |
else:
|
63 |
st.error("The text can't be empty")
|
64 |
|
|
|
14 |
return " ".join(new_text)
|
15 |
|
16 |
|
17 |
+
def get_top_emojis(text, tokenizer, model, top_n=TOP_N):
|
18 |
preprocessed = preprocess(text)
|
19 |
inputs = tokenizer(preprocessed, return_tensors="pt")
|
20 |
preds = model(**inputs).logits
|
|
|
58 |
# Define function to run when submit is clicked
|
59 |
def submit(message):
|
60 |
if len(message) > 0:
|
61 |
+
st.header(get_top_emojis(message, tokenizer=tokenizer, model=model))
|
62 |
else:
|
63 |
st.error("The text can't be empty")
|
64 |
|