rrevoid commited on
Commit
8f7df49
·
1 Parent(s): 52297f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
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
- st.markdown("### Result")
73
- encoded_input = tokenizer(title + ". " + abstract, return_tensors="pt", padding=True,
74
- max_length=1024, truncation=True)
75
- with torch.no_grad():
76
- outputs = model(**encoded_input).pooler_output[:, 0, :]
77
- predict(outputs)
 
 
 
 
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")