Spaces:
Runtime error
Runtime error
wrapper228
commited on
Commit
•
3d8f9f7
1
Parent(s):
cfde6c7
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ with open('labels.pickle', 'rb') as handle:
|
|
11 |
|
12 |
# @st.cache
|
13 |
def predict_topic_by_title_and_abstract(text):
|
14 |
-
tokenized_text = tokenizer(text, return_tensors='pt')
|
15 |
with torch.no_grad():
|
16 |
logits = model(**tokenized_text).logits
|
17 |
probs = torch.nn.functional.softmax(logits[0], dim=0).numpy() * 100
|
|
|
11 |
|
12 |
# @st.cache
|
13 |
def predict_topic_by_title_and_abstract(text):
|
14 |
+
tokenized_text = tokenizer(text, return_tensors='pt', truncation=True)
|
15 |
with torch.no_grad():
|
16 |
logits = model(**tokenized_text).logits
|
17 |
probs = torch.nn.functional.softmax(logits[0], dim=0).numpy() * 100
|