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
8036ed61
authored
Jun 14, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: qa
parent
85e6a0f3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
client/src/pages/api/openapi/kb/appKbSearch.ts
+1
-1
client/src/pages/kb/components/SelectFileModal.tsx
+3
-3
client/src/service/events/generateQA.ts
+3
-3
No files found.
client/src/pages/api/openapi/kb/appKbSearch.ts
View file @
8036ed61
...
@@ -103,7 +103,7 @@ export async function appKbSearch({
...
@@ -103,7 +103,7 @@ export async function appKbSearch({
.
map
((
item
)
=>
`'
${
item
}
'`
)
.
map
((
item
)
=>
`'
${
item
}
'`
)
.
join
(
','
)}
) AND vector <#> '[
${
promptVector
[
0
]}
]' < -
${
similarity
}
order by vector <#> '[
${
.
join
(
','
)}
) AND vector <#> '[
${
promptVector
[
0
]}
]' < -
${
similarity
}
order by vector <#> '[
${
promptVector
[
0
]
promptVector
[
0
]
}
]' limit 1
5
;
}
]' limit 1
0
;
COMMIT;`
COMMIT;`
);
);
...
...
client/src/pages/kb/components/SelectFileModal.tsx
View file @
8036ed61
...
@@ -29,14 +29,14 @@ const fileExtension = '.txt,.doc,.docx,.pdf,.md';
...
@@ -29,14 +29,14 @@ const fileExtension = '.txt,.doc,.docx,.pdf,.md';
const
modeMap
=
{
const
modeMap
=
{
[
TrainingModeEnum
.
qa
]:
{
[
TrainingModeEnum
.
qa
]:
{
maxLen
:
9
000
,
maxLen
:
8
000
,
slideLen
:
3000
,
slideLen
:
3000
,
price
:
ChatModelMap
[
OpenAiChatEnum
.
GPT35
].
price
,
price
:
ChatModelMap
[
OpenAiChatEnum
.
GPT35
].
price
,
isPrompt
:
true
isPrompt
:
true
},
},
[
TrainingModeEnum
.
index
]:
{
[
TrainingModeEnum
.
index
]:
{
maxLen
:
20
00
,
maxLen
:
14
00
,
slideLen
:
6
00
,
slideLen
:
7
00
,
price
:
embeddingPrice
,
price
:
embeddingPrice
,
isPrompt
:
false
isPrompt
:
false
}
}
...
...
client/src/service/events/generateQA.ts
View file @
8036ed61
...
@@ -94,9 +94,9 @@ export async function generateQA(): Promise<any> {
...
@@ -94,9 +94,9 @@ export async function generateQA(): Promise<any> {
messages
:
[
messages
:
[
{
{
obj
:
ChatRoleEnum
.
System
,
obj
:
ChatRoleEnum
.
System
,
value
:
`你是出题人
value
:
`你是出题人
.
${
data
.
prompt
||
'
下面是"一段长文本"'
}
${
data
.
prompt
||
'
用户会发送一段长文本'
}
.
从中选出
15至30个题目和答案.答案详细.按格式返回
: Q1:
从中选出
25 个问题和答案. 答案详细完整. 按格式回答
: Q1:
A1:
A1:
Q2:
Q2:
A2:
A2:
...
...
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