ChatAIGC文档

ChatAIGC全能AI知识库系统PHP版部署文档


接入M3E 向量模型

<p>[TOC]</p> <h1>接入 M3E 向量模型<a href="https://doc.chatmoney.cn/pro/third-deployment/m3e.html#%E6%8E%A5%E5%85%A5-m3e-%E5%90%91%E9%87%8F%E6%A8%A1%E5%9E%8B">​</a></h1> <p>如果你想私有部署的话,可以使用 M3E 向量模型进行替换。M3E 向量模型属于小模型,资源使用不高,CPU 也可以运行。</p> <h2>部署教程<a href="https://doc.chatmoney.cn/pro/third-deployment/m3e.html#%E9%83%A8%E7%BD%B2%E6%95%99%E7%A8%8B">​</a></h2> <p><strong>1、下载Python文件:</strong> <a href="https://doc.chatmoney.cn/docs/download/m3e.zip">点击Python文件</a></p> <pre><code>// 1.解压压缩包: 得到一个 m3e 的目录 // 2.在终端进入到目录中 cd m3e</code></pre> <p><strong>2、下载m3e的模型</strong>: <a href="https://huggingface.co/moka-ai/m3e-large/tree/main">点击下载m3e-large模型</a><img src="https://doc.chatmoney.cn/docs/images/general/third-deployment/m3e/m3e-down.png" alt="" /></p> <p><strong>3、最终整个目录</strong><img src="https://doc.chatmoney.cn/docs/images/general/third-deployment/m3e/m3e-dir.png" alt="" /></p> <p><strong>4、在终端安装依赖 (进入到m3e目录里)</strong></p> <pre><code>pip install -r requirements.txt</code></pre> <p><strong>5、运行项目</strong></p> <pre><code>python main.py</code></pre> <p><strong>6、运行起来的效果</strong><img src="https://doc.chatmoney.cn/docs/images/general/third-deployment/m3e/m3e-run.png" alt="" /></p> <h2>接口测试<a href="https://doc.chatmoney.cn/pro/third-deployment/m3e.html#%E6%8E%A5%E5%8F%A3%E6%B5%8B%E8%AF%95">​</a></h2> <p><code>注意: 需要传递header头参数:</code><img src="https://doc.chatmoney.cn/docs/images/general/third-deployment/m3e/m3e-post.png" alt="" /></p> <pre><code>PS: 注意设置请求头参数(header), 需要你传递1个密钥, 才可以正常访问 如果你没有传递密钥, 请求将会返回(即无权限): { &amp;quot;detail&amp;quot;: &amp;quot;Not authenticated&amp;quot; } Header传参示例: Authorization: Bearer sk-nvO0YlZEIrljq0QXB35b7e4f711d4087Ac215c18De75A407 参数说明: Authorization是参数的名称 Bearer sk-nv... 值 特别说明: sk-nvO0YlZEIrljq0QXB35b7e4f711d4087Ac215c18De75A407 这个密钥是默认的密钥,如果你没有自行修改,默认就传这个值。 如何修改他呢: m3e源码中的main.py, 搜索一直这个值,改成你自己的即可</code></pre> <h2>接入系统<a href="https://doc.chatmoney.cn/pro/third-deployment/m3e.html#%E6%8E%A5%E5%85%A5%E7%B3%BB%E7%BB%9F">​</a></h2> <p><img src="https://doc.chatmoney.cn/docs/images/general/third-deployment/m3e/m3e-set.png" alt="" /></p>

页面列表

ITEM_HTML