diff --git a/next.config.js b/next.config.js index a7963c704..8d9031f46 100644 --- a/next.config.js +++ b/next.config.js @@ -2,7 +2,7 @@ const nextConfig = { output: 'standalone', - reactStrictMode: true, + reactStrictMode: false, compress: true, webpack(config) { diff --git a/src/hooks/usePagination.tsx b/src/hooks/usePagination.tsx index 651db61d2..ed1aff33c 100644 --- a/src/hooks/usePagination.tsx +++ b/src/hooks/usePagination.tsx @@ -41,10 +41,6 @@ export const usePagination = ({ } }); - useEffect(() => { - mutate(1); - }, []); - const Pagination = useCallback(() => { return ( @@ -93,6 +89,10 @@ export const usePagination = ({ ); }, [maxPage, mutate, pageNum]); + useEffect(() => { + mutate(1); + }, [mutate]); + return { pageNum, pageSize, diff --git a/src/pages/api/chat/vectorGpt.ts b/src/pages/api/chat/vectorGpt.ts index b607bed4c..41fa099b3 100644 --- a/src/pages/api/chat/vectorGpt.ts +++ b/src/pages/api/chat/vectorGpt.ts @@ -144,7 +144,8 @@ ${ messages: filterPrompts, frequency_penalty: 0.5, // 越大,重复内容越少 presence_penalty: -0.5, // 越大,越容易出现新内容 - stream: true + stream: true, + stop: ['.!?。'] }, { timeout: 40000, diff --git a/src/pages/api/openapi/chat/vectorGpt.ts b/src/pages/api/openapi/chat/vectorGpt.ts index ee80571be..4b73dcdda 100644 --- a/src/pages/api/openapi/chat/vectorGpt.ts +++ b/src/pages/api/openapi/chat/vectorGpt.ts @@ -166,7 +166,8 @@ ${ messages: filterPrompts, frequency_penalty: 0.5, // 越大,重复内容越少 presence_penalty: -0.5, // 越大,越容易出现新内容 - stream: isStream + stream: isStream, + stop: ['.!?。'] }, { timeout: 180000, diff --git a/src/pages/model/detail/components/ModelDataCard.tsx b/src/pages/model/detail/components/ModelDataCard.tsx index 4d30d176a..500e3c01f 100644 --- a/src/pages/model/detail/components/ModelDataCard.tsx +++ b/src/pages/model/detail/components/ModelDataCard.tsx @@ -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 }) => { - {splitDataLen > 0 && {splitDataLen}条数据正在拆分...} + {splitDataLen > 0 && {splitDataLen}条数据正在拆分,请耐心等待...}