refactor: 尝试去掉nvidia依赖

This commit is contained in:
liqiang-fit2cloud 2024-03-20 12:44:49 +08:00
parent 948102deef
commit 6fdd4d13bc
2 changed files with 5 additions and 2 deletions

View File

@ -13,7 +13,6 @@ import os
import re
from importlib import import_module
from urllib.parse import urljoin, urlparse
import torch.backends
import yaml
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ -91,7 +90,7 @@ class Config(dict):
"EMAIL_HOST_PASSWORD": "",
# 向量模型
"EMBEDDING_MODEL_NAME": "shibing624/text2vec-base-chinese",
"EMBEDDING_DEVICE": "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu",
"EMBEDDING_DEVICE": "cpu",
"EMBEDDING_MODEL_PATH": os.path.join(PROJECT_DIR, 'models'),
# 向量库配置
"VECTOR_STORE_NAME": 'pg_vector'

View File

@ -19,6 +19,10 @@ diskcache = "^5.6.3"
pillow = "^10.2.0"
filetype = "^1.2.0"
chardet = "^5.2.0"
torch = [
{ url = "https://download.pytorch.org/whl/cpu/torch-2.2.1%2Bcpu-cp311-cp311-linux_x86_64.whl", markers = "sys_platform == 'linux'"},
{ url = "https://download.pytorch.org/whl/cpu/torch-2.2.1-cp311-none-macosx_11_0_arm64.whl", markers = "sys_platform == 'darwin' and platform_machine == 'arm64'"}
]
sentence-transformers = "^2.2.2"
blinker = "^1.6.3"
openai = "^1.13.3"