Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,9 +69,12 @@ abstract = st.text_area(" Enter abstract", height=200)
|
|
| 69 |
if not title:
|
| 70 |
st.warning("Please fill in required fields")
|
| 71 |
else:
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
if not title:
|
| 70 |
st.warning("Please fill in required fields")
|
| 71 |
else:
|
| 72 |
+
try:
|
| 73 |
+
st.markdown("### Result")
|
| 74 |
+
encoded_input = tokenizer(title + ". " + abstract, return_tensors="pt", padding=True,
|
| 75 |
+
max_length=1024, truncation=True)
|
| 76 |
+
with torch.no_grad():
|
| 77 |
+
outputs = model(**encoded_input).pooler_output[:, 0, :]
|
| 78 |
+
predict(outputs)
|
| 79 |
+
except Exception:
|
| 80 |
+
st.error("Something went wrong. Try different text or contact me. Telegram: @rrevoid")
|