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
08a310c4
authored
May 10, 2024
by
Archer
Committed by
GitHub
May 10, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update doc (#1430)
parent
50716ff7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
6 deletions
+39
-6
docSite/content/docs/development/faq.md
+1
-1
docSite/content/docs/development/migration/ docker_mongo.md
+10
-5
docSite/content/docs/development/migration/_index.md
+10
-0
docSite/content/docs/development/migration/docker_db.md
+16
-0
packages/service/core/ai/embedding/index.ts
+2
-0
No files found.
docSite/content/docs/development/faq.md
View file @
08a310c4
...
@@ -104,7 +104,7 @@ OneAPI 账号的余额不足,默认 root 用户只有 200 刀,可以手动
...
@@ -104,7 +104,7 @@ OneAPI 账号的余额不足,默认 root 用户只有 200 刀,可以手动
FastGPT 模型配置文件中的 model 必须与 OneAPI 渠道中的模型对应上,否则就会提示这个错误。可检查下面内容:
FastGPT 模型配置文件中的 model 必须与 OneAPI 渠道中的模型对应上,否则就会提示这个错误。可检查下面内容:
1.
OneAPI 中没有配置该模型渠道,或者被禁用了。
1.
OneAPI 中没有配置该模型渠道,或者被禁用了。
2.
修改了 FastGPT 配置文件中一部分的模型,但没有全部修改,仍有模型是 OneAPI 没配置的
。
2.
FastGPT 配置文件有 OneAPI 没有配置的模型。如果 OneAPI 没有配置对应模型的,配置文件中也不要写
。
3.
使用旧的向量模型创建了知识库,后又更新了向量模型。这时候需要删除以前的知识库,重建。
3.
使用旧的向量模型创建了知识库,后又更新了向量模型。这时候需要删除以前的知识库,重建。
如果OneAPI中,没有配置对应的模型,
`config.json`
中也不要配置,否则容易报错。
如果OneAPI中,没有配置对应的模型,
`config.json`
中也不要配置,否则容易报错。
...
...
docSite/content/docs/development/m
ongodump跨环境迁移数据库
.md
→
docSite/content/docs/development/m
igration/ docker_mongo
.md
View file @
08a310c4
---
---
---
weight
:
7
49
weight
:
7
62
title
:
"
FastGPT
mongodump跨环境迁移fastgpt数据库
"
title
:
"
Docker
Mongo迁移(dump模式)
"
description
:
"
FastGPT
私有部署数据迁移问题
"
description
:
"
FastGPT
Docker
Mongo迁移
"
icon
:
upgrad
e
icon
:
databas
e
draft
:
false
draft
:
false
images
:
[]
images
:
[]
---
---
## 作者
[
https://github.com/samqin123
](
https://github.com/samqin123
)
[
相关PR。有问题可打开这里与作者交流
](
https://github.com/labring/FastGPT/pull/1426
)
## 介绍
## 介绍
如何使用Mongodump来完成从A环境到B环境的Fastgpt的mongodb迁移
如何使用Mongodump来完成从A环境到B环境的Fastgpt的mongodb迁移
...
...
docSite/content/docs/development/migration/_index.md
0 → 100644
View file @
08a310c4
---
weight
:
960
title
:
"
迁移&备份"
description
:
"
FastGPT
迁移&备份"
icon
:
settings_backup_restore
draft
:
false
images
:
[]
---
<!-- 960~970 -->
\ No newline at end of file
docSite/content/docs/development/migration/docker_db.md
0 → 100644
View file @
08a310c4
---
weight
:
762
title
:
"
Docker
数据库迁移(无脑操作)"
description
:
"
FastGPT
Docker
数据库备份和迁移"
icon
:
database
draft
:
false
images
:
[]
---
## Copy文件
Docker 部署数据库都会通过 volume 挂载本地的目录进入容器,如果要迁移,直接复制这些目录即可。
`PG 数据`
: pg/data
`Mongo 数据`
: mongo/data
\ No newline at end of file
packages/service/core/ai/embedding/index.ts
View file @
08a310c4
...
@@ -2,6 +2,7 @@ import { VectorModelItemType } from '@fastgpt/global/core/ai/model.d';
...
@@ -2,6 +2,7 @@ import { VectorModelItemType } from '@fastgpt/global/core/ai/model.d';
import
{
getAIApi
}
from
'../config'
;
import
{
getAIApi
}
from
'../config'
;
import
{
countPromptTokens
}
from
'../../../common/string/tiktoken/index'
;
import
{
countPromptTokens
}
from
'../../../common/string/tiktoken/index'
;
import
{
EmbeddingTypeEnm
}
from
'@fastgpt/global/core/ai/constants'
;
import
{
EmbeddingTypeEnm
}
from
'@fastgpt/global/core/ai/constants'
;
import
{
addLog
}
from
'../../../common/system/log'
;
type
GetVectorProps
=
{
type
GetVectorProps
=
{
model
:
VectorModelItemType
;
model
:
VectorModelItemType
;
...
@@ -32,6 +33,7 @@ export async function getVectorsByText({ model, input, type }: GetVectorProps) {
...
@@ -32,6 +33,7 @@ export async function getVectorsByText({ model, input, type }: GetVectorProps) {
})
})
.
then
(
async
(
res
)
=>
{
.
then
(
async
(
res
)
=>
{
if
(
!
res
.
data
)
{
if
(
!
res
.
data
)
{
addLog
.
error
(
'Embedding API is not responding'
,
res
);
return
Promise
.
reject
(
'Embedding API is not responding'
);
return
Promise
.
reject
(
'Embedding API is not responding'
);
}
}
if
(
!
res
?.
data
?.[
0
]?.
embedding
)
{
if
(
!
res
?.
data
?.[
0
]?.
embedding
)
{
...
...
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