arjunanand13 commited on
Commit
3366453
·
verified ·
1 Parent(s): 72662ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -36,7 +36,7 @@ class DocumentRetrievalAndGeneration:
36
  return all_splits
37
 
38
  def encode_texts(self, texts):
39
- encoded_input = self.embedding_tokenizer(texts, padding=True, truncation=True, return_tensors='pt')
40
  with torch.no_grad():
41
  model_output = self.embedding_model(**encoded_input)
42
  embeddings = self.mean_pooling(model_output, encoded_input['attention_mask'])
 
36
  return all_splits
37
 
38
  def encode_texts(self, texts):
39
+ encoded_input = self.embedding_tokenizer(texts, padding=True, truncation=True, max_length=512, return_tensors='pt')
40
  with torch.no_grad():
41
  model_output = self.embedding_model(**encoded_input)
42
  embeddings = self.mean_pooling(model_output, encoded_input['attention_mask'])