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
3294be5e
authored
Apr 24, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: auto refresh split data
parent
ec868472
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
8 deletions
+16
-8
next.config.js
+1
-1
src/hooks/usePagination.tsx
+4
-4
src/pages/api/chat/vectorGpt.ts
+2
-1
src/pages/api/openapi/chat/vectorGpt.ts
+2
-1
src/pages/model/detail/components/ModelDataCard.tsx
+7
-1
No files found.
next.config.js
View file @
3294be5e
...
...
@@ -2,7 +2,7 @@
const
nextConfig
=
{
output
:
'standalone'
,
reactStrictMode
:
tru
e
,
reactStrictMode
:
fals
e
,
compress
:
true
,
webpack
(
config
)
{
...
...
src/hooks/usePagination.tsx
View file @
3294be5e
...
...
@@ -41,10 +41,6 @@ export const usePagination = <T = any,>({
}
});
useEffect
(()
=>
{
mutate
(
1
);
},
[]);
const
Pagination
=
useCallback
(()
=>
{
return
(
<
Flex
alignItems=
{
'center'
}
justifyContent=
{
'end'
}
>
...
...
@@ -93,6 +89,10 @@ export const usePagination = <T = any,>({
);
},
[
maxPage
,
mutate
,
pageNum
]);
useEffect
(()
=>
{
mutate
(
1
);
},
[
mutate
]);
return
{
pageNum
,
pageSize
,
...
...
src/pages/api/chat/vectorGpt.ts
View file @
3294be5e
...
...
@@ -144,7 +144,8 @@ ${
messages
:
filterPrompts
,
frequency_penalty
:
0.5
,
// 越大,重复内容越少
presence_penalty
:
-
0.5
,
// 越大,越容易出现新内容
stream
:
true
stream
:
true
,
stop
:
[
'.!?。'
]
},
{
timeout
:
40000
,
...
...
src/pages/api/openapi/chat/vectorGpt.ts
View file @
3294be5e
...
...
@@ -166,7 +166,8 @@ ${
messages
:
filterPrompts
,
frequency_penalty
:
0.5
,
// 越大,重复内容越少
presence_penalty
:
-
0.5
,
// 越大,越容易出现新内容
stream
:
isStream
stream
:
isStream
,
stop
:
[
'.!?。'
]
},
{
timeout
:
180000
,
...
...
src/pages/model/detail/components/ModelDataCard.tsx
View file @
3294be5e
...
...
@@ -93,10 +93,16 @@ const ModelDataCard = ({ modelId }: { modelId: string }) => {
(
num
=
1
)
=>
{
getData
(
num
);
refetch
();
return
null
;
},
[
getData
,
refetch
]
);
useQuery
([
'refetchData'
],
()
=>
refetchData
(
pageNum
),
{
refetchInterval
:
5000
,
enabled
:
splitDataLen
>
0
});
// 获取所有的数据,并导出 json
const
{
mutate
:
onclickExport
,
isLoading
:
isLoadingExport
=
false
}
=
useMutation
({
mutationFn
:
()
=>
getExportDataList
(
modelId
),
...
...
@@ -170,7 +176,7 @@ const ModelDataCard = ({ modelId }: { modelId: string }) => {
</
Menu
>
</
Flex
>
<
Flex
mt=
{
4
}
>
{
splitDataLen
>
0
&&
<
Box
fontSize=
{
'xs'
}
>
{
splitDataLen
}
条数据正在拆分...
</
Box
>
}
{
splitDataLen
>
0
&&
<
Box
fontSize=
{
'xs'
}
>
{
splitDataLen
}
条数据正在拆分
,请耐心等待
...
</
Box
>
}
<
Box
flex=
{
1
}
/>
<
Input
maxW=
{
'240px'
}
...
...
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