提交 3a6a6fa8 作者: imClumsyPanda

update model_config.py

上级 74800058
...@@ -27,7 +27,6 @@ EMBEDDING_MODEL = "text2vec" ...@@ -27,7 +27,6 @@ EMBEDDING_MODEL = "text2vec"
# Embedding running device # Embedding running device
EMBEDDING_DEVICE = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu" EMBEDDING_DEVICE = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
# supported LLM models # supported LLM models
# llm_model_dict 处理了loader的一些预设行为,如加载位置,模型名称,模型处理器实例 # llm_model_dict 处理了loader的一些预设行为,如加载位置,模型名称,模型处理器实例
# 在以下字典中修改属性值,以指定本地 LLM 模型存储位置 # 在以下字典中修改属性值,以指定本地 LLM 模型存储位置
...@@ -93,13 +92,13 @@ llm_model_dict = { ...@@ -93,13 +92,13 @@ llm_model_dict = {
"pretrained_model_name": "vicuna-13b-hf", "pretrained_model_name": "vicuna-13b-hf",
"local_model_path": None, "local_model_path": None,
"provides": "LLamaLLM" "provides": "LLamaLLM"
}, },
# 直接调用返回requests.exceptions.ConnectionError错误,需要通过huggingface_hub包里的snapshot_download函数 # 直接调用返回requests.exceptions.ConnectionError错误,需要通过huggingface_hub包里的snapshot_download函数
# 下载模型,如果snapshot_download还是返回网络错误,多试几次,一般是可以的, # 下载模型,如果snapshot_download还是返回网络错误,多试几次,一般是可以的,
# 如果仍然不行,则应该是网络加了防火墙(在服务器上这种情况比较常见),基本只能从别的设备上下载, # 如果仍然不行,则应该是网络加了防火墙(在服务器上这种情况比较常见),基本只能从别的设备上下载,
# 然后转移到目标设备了. # 然后转移到目标设备了.
"bloomz-7b1":{ "bloomz-7b1": {
"name" : "bloomz-7b1", "name": "bloomz-7b1",
"pretrained_model_name": "bigscience/bloomz-7b1", "pretrained_model_name": "bigscience/bloomz-7b1",
"local_model_path": None, "local_model_path": None,
"provides": "MOSSLLM" "provides": "MOSSLLM"
...@@ -107,21 +106,21 @@ llm_model_dict = { ...@@ -107,21 +106,21 @@ llm_model_dict = {
}, },
# 实测加载bigscience/bloom-3b需要170秒左右,暂不清楚为什么这么慢 # 实测加载bigscience/bloom-3b需要170秒左右,暂不清楚为什么这么慢
# 应与它要加载专有token有关 # 应与它要加载专有token有关
"bloom-3b":{ "bloom-3b": {
"name" : "bloom-3b", "name": "bloom-3b",
"pretrained_model_name": "bigscience/bloom-3b", "pretrained_model_name": "bigscience/bloom-3b",
"local_model_path": None, "local_model_path": None,
"provides": "MOSSLLM" "provides": "MOSSLLM"
}, },
"baichuan-7b":{ "baichuan-7b": {
"name":"baichuan-7b", "name": "baichuan-7b",
"pretrained_model_name":"baichuan-inc/baichuan-7B", "pretrained_model_name": "baichuan-inc/baichuan-7B",
"local_model_path":None, "local_model_path": None,
"provides":"MOSSLLM" "provides": "MOSSLLM"
}, },
# llama-cpp模型的兼容性问题参考https://github.com/abetlen/llama-cpp-python/issues/204 # llama-cpp模型的兼容性问题参考https://github.com/abetlen/llama-cpp-python/issues/204
"ggml-vicuna-13b-1.1-q5":{ "ggml-vicuna-13b-1.1-q5": {
"name": "ggml-vicuna-13b-1.1-q5", "name": "ggml-vicuna-13b-1.1-q5",
"pretrained_model_name": "lmsys/vicuna-13b-delta-v1.1", "pretrained_model_name": "lmsys/vicuna-13b-delta-v1.1",
# 这里需要下载好模型的路径,如果下载模型是默认路径则它会下载到用户工作区的 # 这里需要下载好模型的路径,如果下载模型是默认路径则它会下载到用户工作区的
...@@ -131,7 +130,7 @@ llm_model_dict = { ...@@ -131,7 +130,7 @@ llm_model_dict = {
# 此外不同时期的ggml格式并不兼容,因此不同时期的ggml需要安装不同的llama-cpp-python库,且实测pip install 不好使 # 此外不同时期的ggml格式并不兼容,因此不同时期的ggml需要安装不同的llama-cpp-python库,且实测pip install 不好使
# 需要手动从https://github.com/abetlen/llama-cpp-python/releases/tag/下载对应的wheel安装 # 需要手动从https://github.com/abetlen/llama-cpp-python/releases/tag/下载对应的wheel安装
# 实测v0.1.63与本模型的vicuna/ggml-vicuna-13b-1.1/ggml-vic13b-q5_1.bin可以兼容 # 实测v0.1.63与本模型的vicuna/ggml-vicuna-13b-1.1/ggml-vic13b-q5_1.bin可以兼容
"local_model_path":f'''{"/".join(os.path.abspath(__file__).split("/")[:3])}/.cache/huggingface/hub/models--vicuna--ggml-vicuna-13b-1.1/blobs/''', "local_model_path": f'''{"/".join(os.path.abspath(__file__).split("/")[:3])}/.cache/huggingface/hub/models--vicuna--ggml-vicuna-13b-1.1/blobs/''',
"provides": "LLamaLLM" "provides": "LLamaLLM"
}, },
...@@ -161,10 +160,10 @@ llm_model_dict = { ...@@ -161,10 +160,10 @@ llm_model_dict = {
"api_base_url": "http://localhost:8000/v1", # "name"修改为fastchat服务中的"api_base_url" "api_base_url": "http://localhost:8000/v1", # "name"修改为fastchat服务中的"api_base_url"
"api_key": "EMPTY" "api_key": "EMPTY"
}, },
"openai-chatgpt-3.5":{ "openai-chatgpt-3.5": {
"name": "gpt-3.5-turbo", "name": "gpt-3.5-turbo",
"pretrained_model_name": "gpt-3.5-turbo", "pretrained_model_name": "gpt-3.5-turbo",
"provides":"FastChatOpenAILLM", "provides": "FastChatOpenAILLM",
"local_model_path": None, "local_model_path": None,
"api_base_url": "https://api.openapi.com/v1", "api_base_url": "https://api.openapi.com/v1",
"api_key": "" "api_key": ""
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论