Skip to content

Commit

Permalink
Hotfix more zip bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
whitead committed May 17, 2023
1 parent 435ccc9 commit 19deca4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion paperqa/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,12 @@ def add_texts(
for metadata in metadatas:
metadata["dockey"] = new_key
metadata["key"] = metadata["key"].replace(key, new_key)
key = new_key
if text_embeddings is None:
text_embeddings = self.embeddings.embed_documents(texts)
if self._faiss_index is not None:
self._faiss_index.add_embeddings(
zip(texts, text_embeddings), metadatas=metadatas
list(zip(texts, text_embeddings)), metadatas=metadatas
)
elif self._doc_index is not None:
self._doc_index.add_texts([citation], metadatas=[{"key": key}])
Expand Down
2 changes: 1 addition & 1 deletion paperqa/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.6.0"
__version__ = "1.6.1"

0 comments on commit 19deca4

Please sign in to comment.