Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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'])
|