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
19ce6f66
authored
Sep 06, 2023
by
Carson Yang
Committed by
GitHub
Sep 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs: fix typo (#263)
Signed-off-by: Carson Yang <yangchuansheng33@gmail.com>
parent
da6e26f9
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
35 deletions
+37
-35
.github/workflows/deploy-preview.yml
+4
-2
docSite/content/docs/custom-models/chatglm2-m3e.md
+12
-12
docSite/content/docs/custom-models/chatglm2.md
+2
-2
docSite/content/docs/custom-models/m3e.md
+2
-2
docSite/content/docs/installation/docker.md
+5
-5
docSite/content/docs/installation/one-api.md
+12
-12
No files found.
.github/workflows/deploy-preview.yml
View file @
19ce6f66
...
@@ -18,7 +18,7 @@ jobs:
...
@@ -18,7 +18,7 @@ jobs:
# Job outputs
# Job outputs
outputs
:
outputs
:
docs
:
${{ steps.filter.outputs.docs
}}
url
:
${{ steps.vercel-action.outputs.preview-url
}}
# Steps represent a sequence of tasks that will be executed as part of the job
# Steps represent a sequence of tasks that will be executed as part of the job
steps
:
steps
:
...
@@ -26,6 +26,8 @@ jobs:
...
@@ -26,6 +26,8 @@ jobs:
-
name
:
Checkout
-
name
:
Checkout
uses
:
actions/checkout@v3
uses
:
actions/checkout@v3
with
:
with
:
ref
:
${{ github.event.pull_request.head.ref }}
repository
:
${{ github.event.pull_request.head.repo.full_name }}
submodules
:
recursive
# Fetch submodules
submodules
:
recursive
# Fetch submodules
fetch-depth
:
0
# Fetch all history for .GitInfo and .Lastmod
fetch-depth
:
0
# Fetch all history for .GitInfo and .Lastmod
...
@@ -76,7 +78,7 @@ jobs:
...
@@ -76,7 +78,7 @@ jobs:
-
name
:
Write md
-
name
:
Write md
run
:
|
run
:
|
echo "# 🤖 Generated by deploy action" > report.md
echo "# 🤖 Generated by deploy action" > report.md
echo "[Deploy Actions Address](${{ needs.deploy-preview.outputs.
docs
}})" >> report.md
echo "[Deploy Actions Address](${{ needs.deploy-preview.outputs.
url
}})" >> report.md
cat report.md
cat report.md
-
name
:
Gh Rebot for Sealos
-
name
:
Gh Rebot for Sealos
uses
:
labring/gh-rebot@v0.0.6
uses
:
labring/gh-rebot@v0.0.6
...
...
docSite/content/docs/custom-models/chatglm2-m3e.md
View file @
19ce6f66
...
@@ -9,16 +9,16 @@ weight: 200
...
@@ -9,16 +9,16 @@ weight: 200
## 前言
## 前言
FastGPT 默认使用了
openai
的 LLM 模型和向量模型,如果想要私有化部署的话,可以使用 ChatGLM2 和 m3e-large 模型。以下是由用户@不做了睡大觉 提供的接入方法。该镜像直接集成了 M3E-Large 和 ChatGLM2-6B 模型,可以直接使用。
FastGPT 默认使用了
OpenAI
的 LLM 模型和向量模型,如果想要私有化部署的话,可以使用 ChatGLM2 和 m3e-large 模型。以下是由用户@不做了睡大觉 提供的接入方法。该镜像直接集成了 M3E-Large 和 ChatGLM2-6B 模型,可以直接使用。
## 部署镜像
## 部署镜像
镜像名:
`stawky/chatglm2-m3e:latest`
+
镜像名:
`stawky/chatglm2-m3e:latest`
国内镜像名:
`registry.cn-hangzhou.aliyuncs.com/kbgpt/chatglm2-m3e:latest`
+
国内镜像名:
`registry.cn-hangzhou.aliyuncs.com/kbgpt/chatglm2-m3e:latest`
端口号: 6006
+
端口号: 6006
镜像默认 sk-key:
`sk-aaabbbcccdddeeefffggghhhiiijjjkkk`
+
镜像默认 sk-key:
`sk-aaabbbcccdddeeefffggghhhiiijjjkkk`
## 接入
OneAPI
## 接入
[One API](/docs/installation/one-api/)
为 chatglm2 和 m3e-large 各添加一个渠道,参数如下:
为 chatglm2 和 m3e-large 各添加一个渠道,参数如下:
...
@@ -50,7 +50,7 @@ curl --location --request POST 'https://domain/v1/chat/completions' \
...
@@ -50,7 +50,7 @@ curl --location --request POST 'https://domain/v1/chat/completions' \
}'
}'
```
```
Authorization 为 sk-aaabbbcccdddeeefffggghhhiiijjjkkk。model 为刚刚在 OneAPI 填写的自定义模型。
Authorization 为 sk-aaabbbcccdddeeefffggghhhiiijjjkkk。model 为刚刚在 One
API 填写的自定义模型。
## 接入 FastGPT
## 接入 FastGPT
...
@@ -94,20 +94,20 @@ M3E 模型的使用方法如下:
...
@@ -94,20 +94,20 @@ M3E 模型的使用方法如下:
1.
创建知识库时候选择 M3E 模型。
1.
创建知识库时候选择 M3E 模型。
注意,一旦选择后,知识库将无法修改向量模型。
注意,一旦选择后,知识库将无法修改向量模型。
!
[
](/imgs/model-m3e2.png)
!
[
](/imgs/model-m3e2.png)
2.
导入数据
2.
导入数据
3.
搜索测试
3.
搜索测试
!
[
](/imgs/model-m3e3.png)
!
[
](/imgs/model-m3e3.png)
4.
应用绑定知识库
4.
应用绑定知识库
注意,应用只能绑定同一个向量模型的知识库,不能跨模型绑定。并且,需要注意调整相似度,不同向量模型的相似度(距离)会有所区别,需要自行测试实验。
注意,应用只能绑定同一个向量模型的知识库,不能跨模型绑定。并且,需要注意调整相似度,不同向量模型的相似度(距离)会有所区别,需要自行测试实验。
!
[
](/imgs/model-m3e4.png)
!
[
](/imgs/model-m3e4.png)
chatglm2 模型的使用方法如下:
chatglm2 模型的使用方法如下:
模型选择 chatglm2 即可
模型选择 chatglm2 即可
docSite/content/docs/custom-models/chatglm2.md
View file @
19ce6f66
...
@@ -68,7 +68,7 @@ ChatGLM2-6B 是开源中英双语对话模型 ChatGLM-6B 的第二代版本,
...
@@ -68,7 +68,7 @@ ChatGLM2-6B 是开源中英双语对话模型 ChatGLM-6B 的第二代版本,
端口号: 6006
端口号: 6006
镜像默认 sk-key:
`sk-aaabbbcccdddeeefffggghhhiiijjjkkk`
镜像默认 sk-key:
`sk-aaabbbcccdddeeefffggghhhiiijjjkkk`
## 接入 OneAPI
## 接入 One
API
为 chatglm2 添加一个渠道,参数如下:
为 chatglm2 添加一个渠道,参数如下:
...
@@ -90,7 +90,7 @@ curl --location --request POST 'https://domain/v1/chat/completions' \
...
@@ -90,7 +90,7 @@ curl --location --request POST 'https://domain/v1/chat/completions' \
}'
}'
```
```
Authorization 为 sk-aaabbbcccdddeeefffggghhhiiijjjkkk。model 为刚刚在 OneAPI 填写的自定义模型。
Authorization 为 sk-aaabbbcccdddeeefffggghhhiiijjjkkk。model 为刚刚在 One
API 填写的自定义模型。
## 接入 FastGPT
## 接入 FastGPT
...
...
docSite/content/docs/custom-models/m3e.md
View file @
19ce6f66
...
@@ -23,7 +23,7 @@ FastGPT 默认使用了 openai 的 embedding 向量模型,如果你想私有
...
@@ -23,7 +23,7 @@ FastGPT 默认使用了 openai 的 embedding 向量模型,如果你想私有
sk-key=xxxx
sk-key=xxxx
```
```
## 接入 OneAPI
## 接入 One
API
添加一个渠道,参数如下:
添加一个渠道,参数如下:
...
@@ -43,7 +43,7 @@ curl --location --request POST 'https://domain/v1/embeddings' \
...
@@ -43,7 +43,7 @@ curl --location --request POST 'https://domain/v1/embeddings' \
}'
}'
```
```
Authorization 为 sk-key。model 为刚刚在 OneAPI 填写的自定义模型。
Authorization 为 sk-key。model 为刚刚在 One
API 填写的自定义模型。
## 接入 FastGPT
## 接入 FastGPT
...
...
docSite/content/docs/installation/docker.md
View file @
19ce6f66
...
@@ -55,11 +55,11 @@ brew install orbstack
...
@@ -55,11 +55,11 @@ brew install orbstack
{{
<
tab
tabName=
"Windows"
>
}}
{{
<
tab
tabName=
"Windows"
>
}}
{{
<
markdownify
>
}}
{{
<
markdownify
>
}}
>
我们建议将源代码和其他数据绑定到 Linux 容器中时,将其存储在 Linux 文件系统中,而不是 Windows 文件系统中。
我们建议将源代码和其他数据绑定到 Linux 容器中时,将其存储在 Linux 文件系统中,而不是 Windows 文件系统中。
>
>
可以选择直接[使用 WSL 2 后端在 Windows 中安装 Docker Desktop](https://docs.docker.com/desktop/wsl/)。
可以选择直接
[
使用 WSL 2 后端在 Windows 中安装 Docker Desktop
](
https://docs.docker.com/desktop/wsl/
)
。
>
>
也可以直接[在 WSL 2 中安装命令行版本的 Docker](https://nickjanetakis.com/blog/install-docker-in-wsl-2-without-docker-desktop)。
也可以直接
[
在 WSL 2 中安装命令行版本的 Docker
](
https://nickjanetakis.com/blog/install-docker-in-wsl-2-without-docker-desktop
)
。
{{
<
/
markdownify
>
}}
{{
<
/
markdownify
>
}}
{{
<
/
tab
>
}}
{{
<
/
tab
>
}}
...
...
docSite/content/docs/installation/one-api.md
View file @
19ce6f66
---
---
title
:
'
部署
one-api
,实现多模型支持'
title
:
'
部署
One
API
,实现多模型支持'
description
:
'
通过接入
one-api
来实现对各种大模型的支持'
description
:
'
通过接入
One
API
来实现对各种大模型的支持'
icon
:
'
Api'
icon
:
'
Api'
draft
:
false
draft
:
false
toc
:
true
toc
:
true
...
@@ -9,9 +9,9 @@ weight: 730
...
@@ -9,9 +9,9 @@ weight: 730
默认情况下,FastGPT 只配置了 GPT 的 3 个模型,如果你需要接入其他模型,需要进行一些额外配置。
默认情况下,FastGPT 只配置了 GPT 的 3 个模型,如果你需要接入其他模型,需要进行一些额外配置。
[
one-api
](
https://github.com/songquanpeng/one-api
)
是一个 OpenAI 接口管理 & 分发系统,可以通过标准的 OpenAI API 格式访问所有的大模型,开箱即用。
[
One API
](
https://github.com/songquanpeng/one-api
)
是一个 OpenAI 接口管理 & 分发系统,可以通过标准的 OpenAI API 格式访问所有的大模型,开箱即用。
FastGPT 可以通过接入
one-api
来实现对各种大模型的支持。部署方法也很简单。
FastGPT 可以通过接入
One API
来实现对各种大模型的支持。部署方法也很简单。
## MySQL 版本
## MySQL 版本
...
@@ -55,17 +55,17 @@ BATCH_UPDATE_INTERVAL=60
...
@@ -55,17 +55,17 @@ BATCH_UPDATE_INTERVAL=60
## 使用步骤
## 使用步骤
### 1. 登录
one-api
### 1. 登录
One API
打开 【
one-api
应用详情】,找到访问地址:
打开 【
One API
应用详情】,找到访问地址:


登录
one-api
登录
One API


### 2. 创建渠道和令牌
### 2. 创建渠道和令牌
在
one-api
中添加对应渠道,直接点击 【添加基础模型】,不要遗漏了向量模型
在
One API
中添加对应渠道,直接点击 【添加基础模型】,不要遗漏了向量模型


创建一个令牌
创建一个令牌
...
@@ -73,12 +73,12 @@ BATCH_UPDATE_INTERVAL=60
...
@@ -73,12 +73,12 @@ BATCH_UPDATE_INTERVAL=60
### 3. 修改 FastGPT 的环境变量
### 3. 修改 FastGPT 的环境变量
有了
one-api 令牌后,FastGPT 可以通过修改 baseurl 和 key 去请求到 one-api,再由 one-api
去请求不同的模型。修改下面两个环境变量:
有了
One API 令牌后,FastGPT 可以通过修改 baseurl 和 key 去请求到 One API,再由 One API
去请求不同的模型。修改下面两个环境变量:
```
bash
```
bash
# 下面的地址是 Sealos 提供的,务必写上 v1, 两个项目都在 sealos 部署时候,https://xxxx.cloud.sealos.io 可以改用内网地址
# 下面的地址是 Sealos 提供的,务必写上 v1, 两个项目都在 sealos 部署时候,https://xxxx.cloud.sealos.io 可以改用内网地址
OPENAI_BASE_URL
=
https://xxxx.cloud.sealos.io/v1
OPENAI_BASE_URL
=
https://xxxx.cloud.sealos.io/v1
# 下面的 key 是由
one-api
提供的令牌
# 下面的 key 是由
One API
提供的令牌
CHAT_API_KEY
=
sk-xxxxxx
CHAT_API_KEY
=
sk-xxxxxx
```
```
...
@@ -86,7 +86,7 @@ CHAT_API_KEY=sk-xxxxxx
...
@@ -86,7 +86,7 @@ CHAT_API_KEY=sk-xxxxxx
**以添加文心一言为例:**
**以添加文心一言为例:**
### 1. One
-
API 添加对应模型渠道
### 1. One
API 添加对应模型渠道
!
[
](/imgs/oneapi-demo1.png)
!
[
](/imgs/oneapi-demo1.png)
...
@@ -98,7 +98,7 @@ CHAT_API_KEY=sk-xxxxxx
...
@@ -98,7 +98,7 @@ CHAT_API_KEY=sk-xxxxxx
"ChatModels"
:
[
"ChatModels"
:
[
...
...
{
{
"model"
:
"ERNIE-Bot"
,
//
这里的模型需要对应
OneAPI
的模型
"model"
:
"ERNIE-Bot"
,
//
这里的模型需要对应
One
API
的模型
"name"
:
"文心一言"
,
//
对外展示的名称
"name"
:
"文心一言"
,
//
对外展示的名称
"contextMaxToken"
:
4000
,
//
最大长下文
token,无论什么模型都按
GPT
35
的计算。GPT
外的模型需要自行大致计算下这个值。可以调用官方接口去比对
Token
的倍率,然后在这里粗略计算。
"contextMaxToken"
:
4000
,
//
最大长下文
token,无论什么模型都按
GPT
35
的计算。GPT
外的模型需要自行大致计算下这个值。可以调用官方接口去比对
Token
的倍率,然后在这里粗略计算。
//
例如:文心一言的中英文
token
基本是
1
:
1
,而
GPT
的中文
Token
是
2
:
1
,如果文心一言官方最大
Token
是
4000
,那么这里就可以填
8000
,保险点就填
7000
.
//
例如:文心一言的中英文
token
基本是
1
:
1
,而
GPT
的中文
Token
是
2
:
1
,如果文心一言官方最大
Token
是
4000
,那么这里就可以填
8000
,保险点就填
7000
.
...
...
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