添加稀疏模型本地缓存功能
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 13m54s

- 创建 download_sparse_model.py 脚本用于下载稀疏模型到本地
- 添加 SPARSE_MODEL_PATH 和 SPARSE_MODEL_NAME 配置
- 修改 retriever.py 和 index_builder.py 使用 cache_dir
- 更新 .gitignore 排除 models/ 目录
- 更新 Dockerfile 在构建时下载稀疏模型
This commit is contained in:
2026-05-03 18:55:39 +08:00
parent 5c45806ad3
commit 2183c901b4
6 changed files with 117 additions and 6 deletions

View File

@@ -51,6 +51,10 @@ ZHIPU_RERANK_MODEL = _get_str("ZHIPU_RERANK_MODEL") or "rerank-2"
ZHIPU_API_BASE = _get_str("ZHIPU_API_BASE") or "https://open.bigmodel.cn/api/paas/v4"
# ========== 稀疏模型配置 ==========
SPARSE_MODEL_PATH = _get_str("SPARSE_MODEL_PATH") or "./models/sparse"
SPARSE_MODEL_NAME = _get_str("SPARSE_MODEL_NAME") or "Qdrant/bm25"
# ========== llama.cpp 服务配置URL + API密钥 配对) ==========
# 主 LLM 服务
VLLM_BASE_URL = _get_str("VLLM_BASE_URL")