Jonas Leeb commited on
Commit
0cbf59f
·
1 Parent(s): fbba6d9

max length scibert bug fix

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -233,7 +233,7 @@ class ArxivSearch:
233
 
234
  def scibert_search(self, query, top_n=10):
235
  with torch.no_grad():
236
- inputs = self.sci_tokenizer(query, return_tensors="pt", truncation=True, padding=True)
237
  outputs = self.sci_model(**inputs)
238
  query_vec = normalize(outputs.last_hidden_state[:, 0, :].numpy())
239
 
 
233
 
234
  def scibert_search(self, query, top_n=10):
235
  with torch.no_grad():
236
+ inputs = self.sci_tokenizer(query, return_tensors="pt", truncation=True, padding=True, max_length=512)
237
  outputs = self.sci_model(**inputs)
238
  query_vec = normalize(outputs.last_hidden_state[:, 0, :].numpy())
239