feat: normalization embedding;feat: model top_p param config (#3723)

* edit form force close image select

* model config

* feat: normalization embedding

* perf: add share page title force refresh
This commit is contained in:
Archer
2025-02-08 12:16:46 +08:00
committed by GitHub
parent 42b2046f96
commit 51e17a47fa
30 changed files with 388 additions and 94 deletions

View File

@@ -1,6 +1,6 @@
import { LOGO_ICON } from '@fastgpt/global/common/system/constants';
import Head from 'next/head';
import React, { useMemo } from 'react';
import React, { useEffect, useMemo } from 'react';
const NextHead = ({ title, icon, desc }: { title?: string; icon?: string; desc?: string }) => {
const formatIcon = useMemo(() => {
@@ -11,6 +11,13 @@ const NextHead = ({ title, icon, desc }: { title?: string; icon?: string; desc?:
return LOGO_ICON;
}, [icon]);
useEffect(() => {
// Force update document title
if (title) {
document.title = title;
}
}, [title]);
return (
<Head>
<title>{title}</title>

View File

@@ -816,6 +816,19 @@ const ModelEditModal = ({
)}
{isEmbeddingModel && (
<>
<Tr>
<Td>
<HStack spacing={1}>
<Box>{t('account:model.normalization')}</Box>
<QuestionTip label={t('account:model.normalization_tip')} />
</HStack>
</Td>
<Td textAlign={'right'}>
<Flex justifyContent={'flex-end'}>
<Switch {...register('normalization')} />
</Flex>
</Td>
</Tr>
<Tr>
<Td>
<HStack spacing={1}>

View File

@@ -28,12 +28,12 @@ function Error() {
return (
<Box whiteSpace={'pre-wrap'}>
{`出现未捕获的异常。
1. 私有部署用户90%由于配置文件不正确/模型未启用导致。
1. 私有部署用户90%由于配置文件不正确/模型未启用导致。请确保系统内每个系列模型至少有一个可用。
2. 部分系统不兼容相关API。大部分是苹果的safari 浏览器导致,可以尝试更换 chrome。
3. 请关闭浏览器翻译功能,部分翻译导致页面崩溃。
排除3后打开控制台的 console 查看具体报错信息。
如果提示 xxx undefined 的话,就是配置文件有错误,或者是缺少可用模型,请确保系统内每个系列模型至少有一个可用
如果提示 xxx undefined 的话,就是配置文件有错误,或者是缺少可用模型。
`}
</Box>
);

View File

@@ -57,7 +57,9 @@ async function handler(
export default NextAPI(handler);
const testLLMModel = async (model: LLMModelItemType) => {
const ai = getAIApi({});
const ai = getAIApi({
timeout: 10000
});
const requestBody = llmCompletionsBodyFormat(
{
model: model.model,
@@ -93,7 +95,9 @@ const testEmbeddingModel = async (model: EmbeddingModelItemType) => {
};
const testTTSModel = async (model: TTSModelType) => {
const ai = getAIApi();
const ai = getAIApi({
timeout: 10000
});
await ai.audio.speech.create(
{
model: model.model,

View File

@@ -241,7 +241,11 @@ const OutLink = (props: Props) => {
return (
<>
<NextHead title={props.appName || 'AI'} desc={props.appIntro} icon={props.appAvatar} />
<NextHead
title={props.appName || data?.app?.name || 'AI'}
desc={props.appIntro || data?.app?.intro}
icon={props.appAvatar || data?.app?.avatar}
/>
<PageContainer
isLoading={loading}
{...(isEmbed