Files
DeepAudit/backend
lintsinghua 8198f2f390 fix: 嵌入模型向量维度可配置,解决 Ollama 不同参数规模模型维度不匹配问题
Fixes #123

问题:qwen3-embedding:8b 实际维度 4096,但代码硬编码为 1024(只适用于 0.6b 版本),导致 RAG 系统初始化失败

修改内容:
- OllamaEmbedding: 构造函数添加 dimension 参数,用户配置优先
- EmbeddingService: 支持传递自定义维度到各提供商
- embedding_config.py:
  - 补充 _get_model_dimensions 缺失的模型映射
  - get_current_config 优先使用用户配置的维度
  - test_embedding 支持传递自定义维度
- 前端 EmbeddingConfig: 添加"自定义向量维度"输入框

使用方式:
在"系统配置-嵌入模型"页面,输入自定义向量维度(如 4096)即可覆盖默认值

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 14:42:31 +08:00
..
2025-12-16 18:55:07 +08:00
2025-12-19 00:01:10 +08:00

DeepAudit Backend

AI-Powered Code Security Audit Platform Backend Service.