fix: download file error
This commit is contained in:
@@ -242,7 +242,7 @@ export default {
|
|||||||
'models.form.backend.custom': 'User-defined',
|
'models.form.backend.custom': 'User-defined',
|
||||||
'models.form.rules.name':
|
'models.form.rules.name':
|
||||||
'Up to 63 characters; letters, numbers, dots (.), underscores (_), and hyphens (-) only; must start and end with an alphanumeric character.',
|
'Up to 63 characters; letters, numbers, dots (.), underscores (_), and hyphens (-) only; must start and end with an alphanumeric character.',
|
||||||
'models.catalog.button.explore': 'Explore Other Models',
|
'models.catalog.button.explore': 'Explore More Models',
|
||||||
'models.catalog.precision': 'Precision',
|
'models.catalog.precision': 'Precision',
|
||||||
'models.form.gpuPerReplica.tips': 'Enter a custom number',
|
'models.form.gpuPerReplica.tips': 'Enter a custom number',
|
||||||
'models.form.generic_proxy': 'Enable Generic Proxy',
|
'models.form.generic_proxy': 'Enable Generic Proxy',
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ export default {
|
|||||||
'models.form.backend.custom': 'User Defined',
|
'models.form.backend.custom': 'User Defined',
|
||||||
'models.form.rules.name':
|
'models.form.rules.name':
|
||||||
'Up to 63 characters; letters, numbers, dots (.), underscores (_), and hyphens (-) only; must start and end with an alphanumeric character.',
|
'Up to 63 characters; letters, numbers, dots (.), underscores (_), and hyphens (-) only; must start and end with an alphanumeric character.',
|
||||||
'models.catalog.button.explore': 'Explore Other Models',
|
'models.catalog.button.explore': 'Explore More Models',
|
||||||
'models.catalog.precision': 'Precision',
|
'models.catalog.precision': 'Precision',
|
||||||
'models.form.gpuPerReplica.tips': 'Enter a custom number',
|
'models.form.gpuPerReplica.tips': 'Enter a custom number',
|
||||||
'models.form.generic_proxy': 'Enable Generic Proxy',
|
'models.form.generic_proxy': 'Enable Generic Proxy',
|
||||||
@@ -321,7 +321,7 @@ export default {
|
|||||||
// 47. 'models.form.quantization': 'Quantization',
|
// 47. 'models.form.quantization': 'Quantization',
|
||||||
// 48. 'models.form.backend.custom': 'User Defined',
|
// 48. 'models.form.backend.custom': 'User Defined',
|
||||||
// 49. 'models.form.rules.name': 'Up to 63 characters; letters, numbers, dots (.), underscores (_), and hyphens (-) only; must start and end with an alphanumeric character.',
|
// 49. 'models.form.rules.name': 'Up to 63 characters; letters, numbers, dots (.), underscores (_), and hyphens (-) only; must start and end with an alphanumeric character.',
|
||||||
// 50. 'models.catalog.button.explore': 'Explore Other Models',
|
// 50. 'models.catalog.button.explore': 'Explore More Models',
|
||||||
// 51. 'models.catalog.precision': 'Precision',
|
// 51. 'models.catalog.precision': 'Precision',
|
||||||
// 52. 'models.form.gpuPerReplica.tips': 'Enter a custom number',
|
// 52. 'models.form.gpuPerReplica.tips': 'Enter a custom number',
|
||||||
// 53. 'models.form.generic_proxy': 'Enable Generic Proxy',
|
// 53. 'models.form.generic_proxy': 'Enable Generic Proxy',
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ export default {
|
|||||||
'models.form.backend.custom': 'Пользовательский',
|
'models.form.backend.custom': 'Пользовательский',
|
||||||
'models.form.rules.name':
|
'models.form.rules.name':
|
||||||
'До 63 символов; только буквы, цифры, точки (.), подчёркивания (_) и дефисы (-); должно начинаться и заканчиваться буквенно-цифровым символом.',
|
'До 63 символов; только буквы, цифры, точки (.), подчёркивания (_) и дефисы (-); должно начинаться и заканчиваться буквенно-цифровым символом.',
|
||||||
'models.catalog.button.explore': 'Изучить другие модели',
|
'models.catalog.button.explore': 'Explore More Models',
|
||||||
'models.catalog.precision': 'Точность',
|
'models.catalog.precision': 'Точность',
|
||||||
'models.form.gpuPerReplica.tips': 'Введите произвольное число',
|
'models.form.gpuPerReplica.tips': 'Введите произвольное число',
|
||||||
'models.form.generic_proxy': 'Включить универсальный прокси',
|
'models.form.generic_proxy': 'Включить универсальный прокси',
|
||||||
@@ -255,5 +255,6 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
||||||
// 7. 'models.table.genericProxy': 'Refer to the curl example below. The proxy forwards requests with the /model/proxy prefix to the corresponding model. You need to specify the model name either in the <span class="bold-text">X-GPUStack-Model</span> request header or in the "model" property of the JSON body.'
|
// 1. 'models.catalog.button.explore': 'Explore More Models',
|
||||||
|
// 2. 'models.table.genericProxy': 'Refer to the curl example below. The proxy forwards requests with the /model/proxy prefix to the corresponding model. You need to specify the model name either in the <span class="bold-text">X-GPUStack-Model</span> request header or in the "model" property of the JSON body.'
|
||||||
// ========== End of To-Do List ==========
|
// ========== End of To-Do List ==========
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ export default {
|
|||||||
'models.form.backend.custom': '用户定义',
|
'models.form.backend.custom': '用户定义',
|
||||||
'models.form.rules.name':
|
'models.form.rules.name':
|
||||||
'长度不超过 63 个字符,只能包含字母、数字、点(.)、下划线(_)和连字符(-),且必须以字母或数字开头和结尾。',
|
'长度不超过 63 个字符,只能包含字母、数字、点(.)、下划线(_)和连字符(-),且必须以字母或数字开头和结尾。',
|
||||||
'models.catalog.button.explore': '浏览其他模型',
|
'models.catalog.button.explore': '浏览更多模型',
|
||||||
'models.catalog.precision': '精度',
|
'models.catalog.precision': '精度',
|
||||||
'models.form.gpuPerReplica.tips': '输入自定义数值',
|
'models.form.gpuPerReplica.tips': '输入自定义数值',
|
||||||
'models.form.generic_proxy': '启用通用代理',
|
'models.form.generic_proxy': '启用通用代理',
|
||||||
|
|||||||
@@ -384,6 +384,7 @@ export async function queryCatalogItemSpec(
|
|||||||
|
|
||||||
export async function evaluationsModelSpec(
|
export async function evaluationsModelSpec(
|
||||||
data: {
|
data: {
|
||||||
|
cluster_id: number;
|
||||||
model_specs: EvaluateSpec[];
|
model_specs: EvaluateSpec[];
|
||||||
},
|
},
|
||||||
options: { token: any }
|
options: { token: any }
|
||||||
|
|||||||
@@ -191,25 +191,6 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
size: number;
|
size: number;
|
||||||
quantization: string;
|
quantization: string;
|
||||||
}) => {
|
}) => {
|
||||||
// const spec = _.find(specListRef.current, (item: CatalogSpec) => {
|
|
||||||
// if (data.size && data.quantization) {
|
|
||||||
// return (
|
|
||||||
// item.size === data.size &&
|
|
||||||
// item.backend === data.backend &&
|
|
||||||
// item.quantization === data.quantization
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// if (data.size) {
|
|
||||||
// return item.size === data.size && item.backend === data.backend;
|
|
||||||
// }
|
|
||||||
// if (data.quantization) {
|
|
||||||
// return (
|
|
||||||
// item.quantization === data.quantization &&
|
|
||||||
// item.backend === data.backend
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// return item.backend === data.backend;
|
|
||||||
// });
|
|
||||||
const defaultSpec = _.find(
|
const defaultSpec = _.find(
|
||||||
specListRef.current,
|
specListRef.current,
|
||||||
(item: CatalogSpec) => item.mode === data.mode
|
(item: CatalogSpec) => item.mode === data.mode
|
||||||
|
|||||||
@@ -252,6 +252,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
|||||||
checkTokenRef.current = createAxiosToken();
|
checkTokenRef.current = createAxiosToken();
|
||||||
const evaluations = await evaluationsModelSpec(
|
const evaluations = await evaluationsModelSpec(
|
||||||
{
|
{
|
||||||
|
cluster_id: clusterId!,
|
||||||
model_specs: repoList
|
model_specs: repoList
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -170,6 +170,10 @@ export const setModelActionList = (record: any) => {
|
|||||||
return record.replicas > 0;
|
return record.replicas > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (action.key === 'proxy') {
|
||||||
|
return record.generic_proxy;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ const DownloadModel: React.FC<AddModalProps> = (props) => {
|
|||||||
|
|
||||||
const handleOnSelectModel = (item: any) => {
|
const handleOnSelectModel = (item: any) => {
|
||||||
setSelectedModel(item);
|
setSelectedModel(item);
|
||||||
|
setFileName('');
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOk = async (values: any) => {
|
const handleOk = async (values: any) => {
|
||||||
|
|||||||
@@ -41,6 +41,15 @@ const KVCacheForm = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleRamRatioChange = (
|
||||||
|
value: number | null | string,
|
||||||
|
field: string
|
||||||
|
) => {
|
||||||
|
if (!value) {
|
||||||
|
form.setFieldValue(['extended_kv_cache', field], null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const builtInBackend = useMemo(() => {
|
const builtInBackend = useMemo(() => {
|
||||||
const currentBackend = backendOptions.find(
|
const currentBackend = backendOptions.find(
|
||||||
(item) => item.value === backend
|
(item) => item.value === backend
|
||||||
@@ -75,6 +84,7 @@ const KVCacheForm = () => {
|
|||||||
<>
|
<>
|
||||||
<Form.Item<FormData> name={['extended_kv_cache', 'ram_ratio']}>
|
<Form.Item<FormData> name={['extended_kv_cache', 'ram_ratio']}>
|
||||||
<SealInputNumber
|
<SealInputNumber
|
||||||
|
onChange={(value) => handleRamRatioChange(value, 'ram_ratio')}
|
||||||
label={intl.formatMessage({ id: 'models.form.ramRatio' })}
|
label={intl.formatMessage({ id: 'models.form.ramRatio' })}
|
||||||
description={intl.formatMessage({
|
description={intl.formatMessage({
|
||||||
id: 'models.form.ramRatio.tips'
|
id: 'models.form.ramRatio.tips'
|
||||||
@@ -86,6 +96,7 @@ const KVCacheForm = () => {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item<FormData> name={['extended_kv_cache', 'ram_size']}>
|
<Form.Item<FormData> name={['extended_kv_cache', 'ram_size']}>
|
||||||
<SealInputNumber
|
<SealInputNumber
|
||||||
|
onChange={(value) => handleRamRatioChange(value, 'ram_size')}
|
||||||
label={intl.formatMessage({ id: 'models.form.ramSize' })}
|
label={intl.formatMessage({ id: 'models.form.ramSize' })}
|
||||||
description={intl.formatMessage(
|
description={intl.formatMessage(
|
||||||
{
|
{
|
||||||
@@ -100,6 +111,7 @@ const KVCacheForm = () => {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item<FormData> name={['extended_kv_cache', 'chunk_size']}>
|
<Form.Item<FormData> name={['extended_kv_cache', 'chunk_size']}>
|
||||||
<SealInputNumber
|
<SealInputNumber
|
||||||
|
onChange={(value) => handleRamRatioChange(value, 'chunk_size')}
|
||||||
label={intl.formatMessage({ id: 'models.form.chunkSize' })}
|
label={intl.formatMessage({ id: 'models.form.chunkSize' })}
|
||||||
description={intl.formatMessage({
|
description={intl.formatMessage({
|
||||||
id: 'models.form.chunkSize.tips'
|
id: 'models.form.chunkSize.tips'
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ const SpeculativeDecode = () => {
|
|||||||
label={intl.formatMessage({ id: 'models.form.numDraftTokens' })}
|
label={intl.formatMessage({ id: 'models.form.numDraftTokens' })}
|
||||||
min={1}
|
min={1}
|
||||||
step={1}
|
step={1}
|
||||||
|
required
|
||||||
precision={0}
|
precision={0}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
@@ -180,6 +180,7 @@ export const useCheckCompatibility = () => {
|
|||||||
});
|
});
|
||||||
const evalution = await evaluationsModelSpec(
|
const evalution = await evaluationsModelSpec(
|
||||||
{
|
{
|
||||||
|
cluster_id: data.cluster_id,
|
||||||
model_specs: [
|
model_specs: [
|
||||||
{
|
{
|
||||||
..._.omit(data, ['scheduleType']),
|
..._.omit(data, ['scheduleType']),
|
||||||
|
|||||||
@@ -17,57 +17,72 @@ import { generateEmbeddingCurlCode } from '@/pages/playground/view-code/embeddin
|
|||||||
import { generateImageCurlCode } from '@/pages/playground/view-code/image';
|
import { generateImageCurlCode } from '@/pages/playground/view-code/image';
|
||||||
import { generateLLmCurlCode } from '@/pages/playground/view-code/llm';
|
import { generateLLmCurlCode } from '@/pages/playground/view-code/llm';
|
||||||
import { generateRerankCurlCode } from '@/pages/playground/view-code/rerank';
|
import { generateRerankCurlCode } from '@/pages/playground/view-code/rerank';
|
||||||
import { formatCurlArgs } from '@/pages/playground/view-code/utils';
|
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { modelCategoriesMap } from '../config';
|
import { modelCategoriesMap } from '../config';
|
||||||
|
|
||||||
const API_MAP: Record<
|
const API_MAP: Record<
|
||||||
string,
|
string,
|
||||||
{ api: string; generateCurlCode: (args: any) => string }
|
{ api: string; parameters: any; generateCurlCode: (args: any) => string }
|
||||||
> = {
|
> = {
|
||||||
[modelCategoriesMap.embedding]: {
|
[modelCategoriesMap.embedding]: {
|
||||||
api: EMBEDDING_API,
|
api: EMBEDDING_API,
|
||||||
|
parameters: {
|
||||||
|
query: 'What are the benefits of regular exercise?',
|
||||||
|
documents: [
|
||||||
|
'Regular physical activity helps improve cardiovascular health and mental well-being.',
|
||||||
|
'Eating too much sugar can lead to health issues.',
|
||||||
|
'Exercise is often done in gyms or outdoors.'
|
||||||
|
]
|
||||||
|
},
|
||||||
generateCurlCode: generateEmbeddingCurlCode
|
generateCurlCode: generateEmbeddingCurlCode
|
||||||
},
|
},
|
||||||
[modelCategoriesMap.llm]: {
|
[modelCategoriesMap.llm]: {
|
||||||
api: CHAT_API,
|
api: CHAT_API,
|
||||||
|
parameters: {
|
||||||
|
messages: [
|
||||||
|
{
|
||||||
|
role: 'user',
|
||||||
|
content: 'Hello, introduce yourself'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
generateCurlCode: generateLLmCurlCode
|
generateCurlCode: generateLLmCurlCode
|
||||||
},
|
},
|
||||||
[modelCategoriesMap.image]: {
|
[modelCategoriesMap.image]: {
|
||||||
api: CREAT_IMAGE_API,
|
api: CREAT_IMAGE_API,
|
||||||
|
parameters: {},
|
||||||
generateCurlCode: generateImageCurlCode
|
generateCurlCode: generateImageCurlCode
|
||||||
},
|
},
|
||||||
[modelCategoriesMap.text_to_speech]: {
|
[modelCategoriesMap.text_to_speech]: {
|
||||||
api: AUDIO_TEXT_TO_SPEECH_API,
|
api: AUDIO_TEXT_TO_SPEECH_API,
|
||||||
|
parameters: {
|
||||||
|
response_format: 'mp3',
|
||||||
|
input: ''
|
||||||
|
},
|
||||||
generateCurlCode: generateTextToSpeechCurlCode
|
generateCurlCode: generateTextToSpeechCurlCode
|
||||||
},
|
},
|
||||||
[modelCategoriesMap.speech_to_text]: {
|
[modelCategoriesMap.speech_to_text]: {
|
||||||
api: AUDIO_SPEECH_TO_TEXT_API,
|
api: AUDIO_SPEECH_TO_TEXT_API,
|
||||||
|
parameters: {},
|
||||||
generateCurlCode: generateSpeechToTextCurlCode
|
generateCurlCode: generateSpeechToTextCurlCode
|
||||||
},
|
},
|
||||||
[modelCategoriesMap.reranker]: {
|
[modelCategoriesMap.reranker]: {
|
||||||
api: RERANKER_API,
|
api: RERANKER_API,
|
||||||
|
parameters: {
|
||||||
|
messages: [
|
||||||
|
{
|
||||||
|
role: 'user',
|
||||||
|
content: 'Hello, introduce yourself'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
generateCurlCode: generateRerankCurlCode
|
generateCurlCode: generateRerankCurlCode
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const langOptions = [{ label: 'Curl', value: 'bash' }];
|
const langOptions = [{ label: 'Curl', value: 'bash' }];
|
||||||
|
|
||||||
const generateCode = ({ api: url, parameters }: Record<string, any>) => {
|
|
||||||
const host = window.location.origin;
|
|
||||||
const api = '/model/proxy/v1/';
|
|
||||||
|
|
||||||
// ========================= Curl =========================
|
|
||||||
const curlCode = `
|
|
||||||
curl ${host}${api} \\
|
|
||||||
-H "Content-Type: application/json" \\
|
|
||||||
-H "Authorization: Bearer $\{YOUR_GPUSTACK_API_KEY}" \\
|
|
||||||
${formatCurlArgs(parameters, false)}`.trim();
|
|
||||||
|
|
||||||
return curlCode;
|
|
||||||
};
|
|
||||||
|
|
||||||
const useGenericProxy = () => {
|
const useGenericProxy = () => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const [modalStatus, setModalStatus] = useState<{
|
const [modalStatus, setModalStatus] = useState<{
|
||||||
@@ -88,6 +103,7 @@ const useGenericProxy = () => {
|
|||||||
return {
|
return {
|
||||||
category,
|
category,
|
||||||
api: `${MODEL_PROXY}${config.api}`,
|
api: `${MODEL_PROXY}${config.api}`,
|
||||||
|
parameters: config.parameters,
|
||||||
generateCurlCode: config.generateCurlCode
|
generateCurlCode: config.generateCurlCode
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -95,12 +111,22 @@ const useGenericProxy = () => {
|
|||||||
return {
|
return {
|
||||||
category: modelCategoriesMap.llm,
|
category: modelCategoriesMap.llm,
|
||||||
api: CHAT_API,
|
api: CHAT_API,
|
||||||
|
parameters: {
|
||||||
|
messages: [
|
||||||
|
{
|
||||||
|
role: 'user',
|
||||||
|
content: 'Hello, introduce yourself'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
generateCurlCode: generateLLmCurlCode
|
generateCurlCode: generateLLmCurlCode
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const openProxyModal = (data?: any) => {
|
const openProxyModal = (data?: any) => {
|
||||||
const { api, generateCurlCode } = getModelCategory(data?.categories || []);
|
const { api, generateCurlCode, parameters } = getModelCategory(
|
||||||
|
data?.categories || []
|
||||||
|
);
|
||||||
|
|
||||||
setModalStatus({
|
setModalStatus({
|
||||||
open: true,
|
open: true,
|
||||||
@@ -108,7 +134,8 @@ const useGenericProxy = () => {
|
|||||||
api,
|
api,
|
||||||
modelProxy: true,
|
modelProxy: true,
|
||||||
parameters: {
|
parameters: {
|
||||||
model: data?.name || ''
|
model: data?.name || '',
|
||||||
|
...parameters
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -52,13 +52,13 @@ const GroundLeft: React.FC<MessageProps> = forwardRef((props, ref) => {
|
|||||||
handleAddNewMessage,
|
handleAddNewMessage,
|
||||||
handleClear,
|
handleClear,
|
||||||
setMessageList,
|
setMessageList,
|
||||||
|
formRef,
|
||||||
tokenResult,
|
tokenResult,
|
||||||
messageList,
|
messageList,
|
||||||
loading
|
loading
|
||||||
} = useChatCompletion(scroller);
|
} = useChatCompletion(scroller);
|
||||||
const {
|
const {
|
||||||
handleOnValuesChange,
|
handleOnValuesChange,
|
||||||
formRef,
|
|
||||||
paramsRef,
|
paramsRef,
|
||||||
paramsConfig,
|
paramsConfig,
|
||||||
initialValues,
|
initialValues,
|
||||||
@@ -108,7 +108,7 @@ const GroundLeft: React.FC<MessageProps> = forwardRef((props, ref) => {
|
|||||||
return message;
|
return message;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSendMessage = (message: Omit<MessageItem, 'uid'>) => {
|
const handleSendMessage = async (message: Omit<MessageItem, 'uid'>) => {
|
||||||
const currentMessage = generateValidMessage(message);
|
const currentMessage = generateValidMessage(message);
|
||||||
submitMessage({
|
submitMessage({
|
||||||
system: systemMessage
|
system: systemMessage
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export default function useChatCompletion(
|
|||||||
const currentMessageRef = useRef<any>(null);
|
const currentMessageRef = useRef<any>(null);
|
||||||
const messageListLengthCache = useRef<number>(0);
|
const messageListLengthCache = useRef<number>(0);
|
||||||
const reasonContentRef = useRef('');
|
const reasonContentRef = useRef('');
|
||||||
|
const formRef = useRef<any>(null);
|
||||||
|
|
||||||
const setMessageId = () => {
|
const setMessageId = () => {
|
||||||
messageId.current = messageId.current + 1;
|
messageId.current = messageId.current + 1;
|
||||||
@@ -43,7 +44,6 @@ export default function useChatCompletion(
|
|||||||
};
|
};
|
||||||
|
|
||||||
const joinMessage = (chunk: any) => {
|
const joinMessage = (chunk: any) => {
|
||||||
console.log('chunk:', chunk);
|
|
||||||
setTokenResult({
|
setTokenResult({
|
||||||
...(chunk?.usage ?? {})
|
...(chunk?.usage ?? {})
|
||||||
});
|
});
|
||||||
@@ -217,6 +217,7 @@ export default function useChatCompletion(
|
|||||||
loading,
|
loading,
|
||||||
tokenResult,
|
tokenResult,
|
||||||
messageList,
|
messageList,
|
||||||
|
formRef,
|
||||||
setMessageId,
|
setMessageId,
|
||||||
setMessageList,
|
setMessageList,
|
||||||
handleClear,
|
handleClear,
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ export const useInitLLmMeta = (
|
|||||||
defaultValues = {},
|
defaultValues = {},
|
||||||
defaultParamsConfig = []
|
defaultParamsConfig = []
|
||||||
} = options;
|
} = options;
|
||||||
const formRef = useRef<any>(null);
|
|
||||||
const [searchParams] = useSearchParams();
|
const [searchParams] = useSearchParams();
|
||||||
const [modelMeta, setModelMeta] = useState<any>({});
|
const [modelMeta, setModelMeta] = useState<any>({});
|
||||||
const [initialValues, setInitialValues] = useState<any>({
|
const [initialValues, setInitialValues] = useState<any>({
|
||||||
@@ -76,8 +75,6 @@ export const useInitLLmMeta = (
|
|||||||
return model;
|
return model;
|
||||||
}, [model, modelList, isChat]);
|
}, [model, modelList, isChat]);
|
||||||
|
|
||||||
const getLLamaBoxMeta = (meta: any) => {};
|
|
||||||
|
|
||||||
const getMaxTokens = (meta: any) => {
|
const getMaxTokens = (meta: any) => {
|
||||||
const { max_model_len, n_ctx, n_slot, max_total_tokens } = meta || {};
|
const { max_model_len, n_ctx, n_slot, max_total_tokens } = meta || {};
|
||||||
|
|
||||||
@@ -197,7 +194,6 @@ export const useInitLLmMeta = (
|
|||||||
setInitialValues,
|
setInitialValues,
|
||||||
setParams,
|
setParams,
|
||||||
setParamsConfig,
|
setParamsConfig,
|
||||||
formRef,
|
|
||||||
paramsConfig,
|
paramsConfig,
|
||||||
initialValues,
|
initialValues,
|
||||||
parameters,
|
parameters,
|
||||||
|
|||||||
Reference in New Issue
Block a user