mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-02-01 11:53:24 +08:00
更新依赖
This commit is contained in:
parent
e5acf3d2e6
commit
dc07cba1d4
@ -10,7 +10,7 @@ sentence_transformers==2.2.2
|
||||
langchain==0.0.354
|
||||
langchain-experimental==0.0.47
|
||||
pydantic==1.10.13
|
||||
fschat==0.2.34
|
||||
fschat==0.2.35
|
||||
openai~=1.7.1
|
||||
fastapi~=0.108.0
|
||||
sse_starlette==1.8.2
|
||||
|
||||
@ -8,7 +8,7 @@ sentence_transformers==2.2.2
|
||||
langchain==0.0.354
|
||||
langchain-experimental==0.0.47
|
||||
pydantic==1.10.13
|
||||
fschat==0.2.34
|
||||
fschat==0.2.35
|
||||
openai~=1.7.1
|
||||
fastapi~=0.108.0
|
||||
sse_starlette==1.8.2
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
langchain==0.0.354
|
||||
langchain-experimental==0.0.47
|
||||
pydantic==1.10.13
|
||||
fschat==0.2.34
|
||||
fschat==0.2.35
|
||||
openai~=1.7.1
|
||||
fastapi~=0.108.0
|
||||
sse_starlette==1.8.2
|
||||
|
||||
@ -16,13 +16,10 @@ class ZillizKBService(KBService):
|
||||
from pymilvus import Collection
|
||||
return Collection(zilliz_name)
|
||||
|
||||
# def save_vector_store(self):
|
||||
# if self.zilliz.col:
|
||||
# self.zilliz.col.flush()
|
||||
|
||||
def get_doc_by_ids(self, ids: List[str]) -> List[Document]:
|
||||
result = []
|
||||
if self.zilliz.col:
|
||||
ids = [int(id) for id in ids] # for milvus if needed
|
||||
data_list = self.zilliz.col.query(expr=f'pk in {ids}', output_fields=["*"])
|
||||
for data in data_list:
|
||||
text = data.pop("text")
|
||||
@ -50,8 +47,7 @@ class ZillizKBService(KBService):
|
||||
def _load_zilliz(self):
|
||||
zilliz_args = kbs_config.get("zilliz")
|
||||
self.zilliz = Zilliz(embedding_function=EmbeddingsFunAdapter(self.embed_model),
|
||||
collection_name=self.kb_name, connection_args=zilliz_args)
|
||||
|
||||
collection_name=self.kb_name, connection_args=zilliz_args)
|
||||
|
||||
def do_init(self):
|
||||
self._load_zilliz()
|
||||
@ -95,9 +91,7 @@ class ZillizKBService(KBService):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
from server.db.base import Base, engine
|
||||
|
||||
Base.metadata.create_all(bind=engine)
|
||||
zillizService = ZillizKBService("test")
|
||||
|
||||
|
||||
@ -503,16 +503,12 @@ def set_httpx_config(
|
||||
no_proxy.append(host)
|
||||
os.environ["NO_PROXY"] = ",".join(no_proxy)
|
||||
|
||||
# TODO: 简单的清除系统代理不是个好的选择,影响太多。似乎修改代理服务器的bypass列表更好。
|
||||
# patch requests to use custom proxies instead of system settings
|
||||
def _get_proxies():
|
||||
return proxies
|
||||
|
||||
import urllib.request
|
||||
urllib.request.getproxies = _get_proxies
|
||||
|
||||
# 自动检查torch可用的设备。分布式部署时,不运行LLM的机器上可以不装torch
|
||||
|
||||
|
||||
def detect_device() -> Literal["cuda", "mps", "cpu"]:
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user