This commit is contained in:
archer
2023-05-27 15:10:19 +08:00
parent 741381ecb0
commit 4f0bd677f2
5 changed files with 6 additions and 21 deletions

View File

@@ -17,7 +17,7 @@ services:
- /root/fastgpt/pg/data:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro
mongodb:
image: mongo:6.0.4
image: mongo:5.0.18
container_name: mongo
restart: always
ports:
@@ -47,6 +47,9 @@ services:
- aliAccessKeySecret=xxxx
- aliSignName=xxxxx
- aliTemplateCode=SMS_xxxx
# QA和向量生成最大进程数
- QA_MAX_PROCESS=10
- VECTOR_MAX_PROCESS=10
# token加密凭证随便填作为登录凭证
- TOKEN_KEY=xxxx
# root key, 最高权限,可以内部接口互相调用

View File

@@ -5,10 +5,9 @@ CREATE EXTENSION IF NOT EXISTS vector;
-- init table
CREATE TABLE IF NOT EXISTS modelData (
id BIGSERIAL PRIMARY KEY,
vector VECTOR(1536),
vector VECTOR(1536) NOT NULL,
status VARCHAR(50) NOT NULL,
user_id VARCHAR(50) NOT NULL,
model_id VARCHAR(50),
kb_id VARCHAR(50),
q TEXT NOT NULL,
a TEXT NOT NULL
@@ -16,6 +15,5 @@ CREATE TABLE IF NOT EXISTS modelData (
-- create index
CREATE INDEX IF NOT EXISTS modelData_status_index ON modelData USING HASH (status);
CREATE INDEX IF NOT EXISTS modelData_userId_index ON modelData USING HASH (user_id);
CREATE INDEX IF NOT EXISTS modelData_modelId_index ON modelData USING HASH (model_id);
CREATE INDEX IF NOT EXISTS modelData_kbId_index ON modelData USING HASH (kb_id);
EOSQL

View File

@@ -2,7 +2,7 @@
第一次开发,请先[部署教程](../deploy/docker.md),需要部署数据库.
## 环境变量配置
## 环境变量配置 (可能更新不及时,以 docker-compose 里的变量为准)
复制.env.template 文件,生成一个.env.local 环境变量文件夹,修改.env.local 里内容。

View File

@@ -149,14 +149,6 @@ A2:
lockTime: new Date('2000/1/1')
});
// 频率限制
if (err?.response?.statusText === 'Too Many Requests') {
console.log('生成向量次数限制20s后尝试');
return setTimeout(() => {
generateQA();
}, 20000);
}
setTimeout(() => {
generateQA();
}, 1000);

View File

@@ -130,14 +130,6 @@ export async function generateVector(): Promise<any> {
lockTime: new Date('2000/1/1')
});
// 频率限制
if (err?.response?.statusText === 'Too Many Requests') {
console.log('生成向量次数限制20s后尝试');
return setTimeout(() => {
generateVector();
}, 20000);
}
setTimeout(() => {
generateVector();
}, 1000);