add oceanbase

This commit is contained in:
渠磊 2025-04-10 15:25:15 +08:00
parent 5c2242d553
commit f63730b30f
3 changed files with 23 additions and 1 deletions

View file

@ -74,6 +74,17 @@ else
$DOWNLOAD_CMD "data/.config.yaml" "https://raw.githubusercontent.com/xinnan-tech/xiaozhi-esp32-server/main/main/xiaozhi-server/config.yaml"
fi
# 下载量化模型
echo "下载量化模型..."
mkdir -p models/all-MiniLM-L6-v2
if [ "$DOWNLOAD_CMD" = "powershell -Command Invoke-WebRequest -Uri" ]; then
$DOWNLOAD_CMD "https://public.ukp.informatik.tu-darmstadt.de/reimers/sentence-transformers/v0.2/all-MiniLM-L6-v2.zip" $DOWNLOAD_CMD_SUFFIX "models/all-MiniLM-L6-v2/all-MiniLM-L6-v2.zip"
else
$DOWNLOAD_CMD "models/all-MiniLM-L6-v2.zip" "https://public.ukp.informatik.tu-darmstadt.de/reimers/sentence-transformers/v0.2/all-MiniLM-L6-v2.zip"
fi
unzip models/all-MiniLM-L6-v2.zip -d models/all-MiniLM-L6-v2
# 检查文件是否存在
echo "检查文件完整性..."
FILES_TO_CHECK="docker-compose.yml data/.config.yaml models/SenseVoiceSmall/model.pt"

View file

@ -306,6 +306,17 @@ LLM:
- 线路二:百度网盘下载[SenseVoiceSmall](https://pan.baidu.com/share/init?surl=QlgM58FHhYv1tFnUT_A8Sg&pwd=qvna) 提取码:
`qvna`
如果需要使用 oceanbase 的长期记忆向量化能力需要额外下载量化模型,用于把历史对话向量化到成向量化数据。目前支持 `all-MiniLM-L6-v2` 模型。因为模型较大,需要独立下载,
```
wget https://public.ukp.informatik.tu-darmstadt.de/reimers/sentence-transformers/v0.2/all-MiniLM-L6-v2.zip
mkdir models/all-MiniLM-L6-v2
```
解压后放在`models/all-MiniLM-L6-v2`目录下。
```
## 运行状态确认
如果你能看到,类似以下日志,则是本项目服务启动成功的标志。

View file

@ -29,7 +29,7 @@ class MemoryProvider(MemoryProviderBase):
self.model_path = config.get("model_path", "models/all-MiniLM-L6-v2")
self.model_path = os.path.abspath(self.model_path)
if not os.path.exists(self.model_path):
raise Exception(f"模型路径不存在,请下载到: {self.model_path}")
raise Exception(f"模型路径不存在,请下载量化模型 https://public.ukp.informatik.tu-darmstadt.de/reimers/sentence-transformers/v0.2/all-MiniLM-L6-v2.zip 并解压到: {self.model_path}")
print(f"连接到 oceanbase 服务: {self.uri}")
self.client = self.connect_to_client()