rrevoid commited on
Commit
dbc0dcf
·
1 Parent(s): 02d9909

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -44,7 +44,7 @@ def predict(outputs):
44
  top += percent
45
  top_cats.append(cat)
46
  top_probs.append(round(percent, 1))
47
- return pd.DataFrame(top_probs, index=top_cats, columns=['Percent'])
48
 
49
  tokenizer = RobertaTokenizer.from_pretrained("roberta-large-mnli")
50
  model = init_model()
@@ -64,7 +64,7 @@ if not title:
64
  else:
65
  st.markdown("### Result")
66
  encoded_input = tokenizer(title + ". " + abstract, return_tensors="pt", padding=True,
67
- max_length = 512, truncation=True)
68
  with torch.no_grad():
69
  outputs = model(**encoded_input).pooler_output[:, 0, :]
70
  res = predict(outputs)
 
44
  top += percent
45
  top_cats.append(cat)
46
  top_probs.append(round(percent, 1))
47
+ return pd.DataFrame(top_probs, index=top_cats, columns=['Percent'])
48
 
49
  tokenizer = RobertaTokenizer.from_pretrained("roberta-large-mnli")
50
  model = init_model()
 
64
  else:
65
  st.markdown("### Result")
66
  encoded_input = tokenizer(title + ". " + abstract, return_tensors="pt", padding=True,
67
+ max_length=1024, truncation=True)
68
  with torch.no_grad():
69
  outputs = model(**encoded_input).pooler_output[:, 0, :]
70
  res = predict(outputs)