merge master

This commit is contained in:
imClumsyPanda 2023-06-14 21:21:56 +08:00
commit 331f39cde7
4 changed files with 6 additions and 3 deletions

View File

@ -229,6 +229,7 @@ Web UI 可以实现如下功能:
- [x] VUE 前端 - [x] VUE 前端
## 项目交流群 ## 项目交流群
![二维码](img/qr_code_30.jpg) <img src="img/qr_code_32.jpg" alt="二维码" width="300" height="300" />
🎉 langchain-ChatGLM 项目交流群,如果你也对本项目感兴趣,欢迎加入群聊参与讨论交流。
🎉 langchain-ChatGLM 项目微信交流群,如果你也对本项目感兴趣,欢迎加入群聊参与讨论交流。

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 KiB

BIN
img/qr_code_32.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

View File

@ -5,6 +5,7 @@ from typing import Any, Callable, List, Tuple, Dict
from langchain.docstore.base import Docstore from langchain.docstore.base import Docstore
from langchain.docstore.document import Document from langchain.docstore.document import Document
import numpy as np import numpy as np
import copy
class MyFAISS(FAISS, VectorStore): class MyFAISS(FAISS, VectorStore):
@ -95,7 +96,8 @@ class MyFAISS(FAISS, VectorStore):
for id in id_seq: for id in id_seq:
if id == id_seq[0]: if id == id_seq[0]:
_id = self.index_to_docstore_id[id] _id = self.index_to_docstore_id[id]
doc = self.docstore.search(_id) # doc = self.docstore.search(_id)
doc = copy.deepcopy(self.docstore.search(_id))
else: else:
_id0 = self.index_to_docstore_id[id] _id0 = self.index_to_docstore_id[id]
doc0 = self.docstore.search(_id0) doc0 = self.docstore.search(_id0)