Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
c1f47853
authored
Aug 31, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs
parent
b22c878c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
29 deletions
+24
-29
docSite/content/docs/custom-models/chatglm2-m3e.md
+10
-8
docSite/content/docs/custom-models/chatglm2.md
+13
-20
docSite/content/docs/custom-models/m3e.md
+1
-1
No files found.
docSite/content/docs/custom-models/chatglm2-m3e.md
View file @
c1f47853
...
...
@@ -4,27 +4,28 @@ description: ' 将 FastGPT 接入私有化模型 ChatGLM2和m3e-large'
icon
:
'
model_training'
draft
:
false
toc
:
true
weight
:
1
00
weight
:
2
00
---
## 前言
FastGPT 默认使用了 openai 的 LLM
模型和向量模型,如果想要私有化部署的话,可以使用 ChatGLM2 和 m3e-large 模型。以下是由用户@不做了睡大觉 提供的接入方法
。
FastGPT 默认使用了 openai 的 LLM
模型和向量模型,如果想要私有化部署的话,可以使用 ChatGLM2 和 m3e-large 模型。以下是由用户@不做了睡大觉 提供的接入方法。该镜像直接集成了 M3E-Large 和 ChatGLM2-6B 模型,可以直接使用
。
## 部署镜像
镜像名:
`stawky/chatglm2-m3e:latest`
国内镜像名:
`registry.cn-hangzhou.aliyuncs.com/fastgpt/chatglm2-m3e:latest`
端口号: 6006
镜像默认sk-key:
`sk-aaabbbcccdddeeefffggghhhiiijjjkkk`
镜像默认
sk-key:
`sk-aaabbbcccdddeeefffggghhhiiijjjkkk`
## 接入 OneAPI
为
chatglm2和m3e-large
各添加一个渠道,参数如下:
为
chatglm2 和 m3e-large
各添加一个渠道,参数如下:
!
[
](/imgs/model-m3e1.png)
这里我填入m3e作为向量模型,chatglm2作为语言模型
这里我填入 m3e 作为向量模型,chatglm2 作为语言模型
## 测试
curl 例子:
...
...
@@ -53,7 +54,7 @@ Authorization 为 sk-aaabbbcccdddeeefffggghhhiiijjjkkk。model 为刚刚在 OneA
## 接入 FastGPT
修改 config.json 配置文件,在 VectorModels 中加入 chatglm2
和
M3E 模型:
修改 config.json 配置文件,在 VectorModels 中加入 chatglm2
和
M3E 模型:
```
json
"ChatModels"
:
[
...
...
@@ -88,7 +89,9 @@ Authorization 为 sk-aaabbbcccdddeeefffggghhhiiijjjkkk。model 为刚刚在 OneA
```
## 测试使用
M3E 模型的使用方法如下:
1.
创建知识库时候选择 M3E 模型。
注意,一旦选择后,知识库将无法修改向量模型。
...
...
@@ -107,4 +110,4 @@ M3E 模型的使用方法如下:
!
[
](/imgs/model-m3e4.png)
chatglm2 模型的使用方法如下:
模型选择chatglm2即可
\ No newline at end of file
模型选择 chatglm2 即可
docSite/content/docs/custom-models/chatglm2.md
View file @
c1f47853
...
...
@@ -4,7 +4,7 @@ description: ' 将 FastGPT 接入私有化模型 ChatGLM2-6B'
icon
:
'
model_training'
draft
:
false
toc
:
true
weight
:
753
weight
:
100
---
## 前言
...
...
@@ -35,13 +35,15 @@ ChatGLM2-6B 是开源中英双语对话模型 ChatGLM-6B 的第二代版本,
| int4 | >=16GB | >=6GB | >=25GB | python openai_api.py 4 |
{{
<
/
table
>
}}
## 环境配置
## 部署
### 环境要求
-
Python 3.8.10
-
CUDA 11.8
-
科学上网环境
##
部署步骤
##
# 源码部署
1.
根据上面的环境配置配置好环境,具体教程自行 GPT;
2.
下载
[
python 文件
](
https://github.com/labring/FastGPT/blob/main/files/models/ChatGLM2/openai_api.py
)
...
...
@@ -57,31 +59,23 @@ ChatGLM2-6B 是开源中英双语对话模型 ChatGLM-6B 的第二代版本,
> 这里的 `http://0.0.0.0:6006` 就是连接地址。
然后现在回到 .env.local 文件,依照以下方式配置地址:
```
bash
OPENAI_BASE_URL
=
http://127.0.0.1:6006/v1
CHAT_API_KEY
=
sk-aaabbbcccdddeeefffggghhhiiijjjkkk
# 这里是你在代码中配置的 token,这里的 OPENAIKEY 可以任意填写
```
这样就成功接入 ChatGLM2-6B 了。
## docker 部署
### docker 部署
## 部署镜像
**镜像和端口**
镜像名:
`stawky/chatglm2:latest`
国内镜像名:
`registry.cn-hangzhou.aliyuncs.com/fastgpt/chatglm2:latest`
端口号: 6006
镜像默认sk-key:
`sk-aaabbbcccdddeeefffggghhhiiijjjkkk`
镜像默认
sk-key:
`sk-aaabbbcccdddeeefffggghhhiiijjjkkk`
## 接入 OneAPI
为
chatglm2
添加一个渠道,参数如下:
为
chatglm2
添加一个渠道,参数如下:
!
[
](/imgs/model-m3e1.png)
这里我填入chatglm2作为语言模型
这里我填入 chatglm2 作为语言模型
## 测试
curl 例子:
...
...
@@ -100,7 +94,7 @@ Authorization 为 sk-aaabbbcccdddeeefffggghhhiiijjjkkk。model 为刚刚在 OneA
## 接入 FastGPT
修改 config.json 配置文件,在 VectorModels 中加入 chatglm2
和
M3E 模型:
修改 config.json 配置文件,在 VectorModels 中加入 chatglm2
和
M3E 模型:
```
json
"ChatModels"
:
[
...
...
@@ -120,5 +114,4 @@ Authorization 为 sk-aaabbbcccdddeeefffggghhhiiijjjkkk。model 为刚刚在 OneA
## 测试使用
chatglm2 模型的使用方法如下:
模型选择chatglm2即可
模型选择 chatglm2 即可
docSite/content/docs/custom-models/m3e.md
View file @
c1f47853
...
...
@@ -9,7 +9,7 @@ weight: 100
## 前言
FastGPT 默认使用了 openai 的 embedding 向量模型,如果你想私有部署的话,可以使用 M3E 向量模型进行替换。M3E 向量模型属于小模型,资源使用不高,CPU 也可以运行。下面教程是基于 “睡大觉” 同学提供的一个
CPU 版本
的镜像。
FastGPT 默认使用了 openai 的 embedding 向量模型,如果你想私有部署的话,可以使用 M3E 向量模型进行替换。M3E 向量模型属于小模型,资源使用不高,CPU 也可以运行。下面教程是基于 “睡大觉” 同学提供的一个的镜像。
## 部署镜像
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment