1 Star 0 Fork 7

牧师/本地知识库(LangChain+LLMs)

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
config.py 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
yanxin_Thomas 提交于 2023-04-28 23:43 . 更改向量存储为Qdrant
import os
import torch
# device config
EMBEDDING_DEVICE = "cuda" if torch.cuda.is_available(
) else "mps" if torch.backends.mps.is_available() else "cpu"
LLM_DEVICE = "cuda" if torch.cuda.is_available(
) else "mps" if torch.backends.mps.is_available() else "cpu"
num_gpus = torch.cuda.device_count()
# model cache config
MODEL_CACHE_PATH = os.path.join(os.path.dirname(__file__), 'model_cache')
# vector storage config
VECTOR_STORE_PATH='./vector_store'
COLLECTION_NAME='my_collection'
# init model config
init_llm = "ChatGLM-6B-int8"
init_embedding_model = "text2vec-base"
# model config
embedding_model_dict = {
"ernie-tiny": "nghuyong/ernie-3.0-nano-zh",
"ernie-base": "nghuyong/ernie-3.0-base-zh",
"ernie-medium": "nghuyong/ernie-3.0-medium-zh",
"ernie-xbase": "nghuyong/ernie-3.0-xbase-zh",
"text2vec-base": "GanymedeNil/text2vec-base-chinese",
'simbert-base-chinese': 'WangZeJun/simbert-base-chinese',
'paraphrase-multilingual-MiniLM-L12-v2': "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2"
}
llm_model_dict = {
"chatglm": {
"ChatGLM-6B": "THUDM/chatglm-6b",
"ChatGLM-6B-int4": "THUDM/chatglm-6b-int4",
"ChatGLM-6B-int8": "THUDM/chatglm-6b-int8",
"ChatGLM-6b-int4-qe": "THUDM/chatglm-6b-int4-qe"
},
"belle": {
"BELLE-LLaMA-Local": "/pretrainmodel/belle",
},
"vicuna": {
"Vicuna-Local": "/pretrainmodel/vicuna",
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/LvYanGGIT/LangChain_plus_LLMs.git
git@gitee.com:LvYanGGIT/LangChain_plus_LLMs.git
LvYanGGIT
LangChain_plus_LLMs
本地知识库(LangChain+LLMs)
master

搜索帮助