fix: add backend field in evaluation payload

main
jialin 1 year ago
parent f6bc183972
commit c09503aad8

@ -62,8 +62,8 @@ export default {
'models.search.gguf.tips':
'GGUF 模型用 llama-box(支持 Linux, macOS 和 Windows)。',
'models.search.vllm.tips':
' 非 GGUF 的模型用 vox-box其它非 GGUF 的模型用 vLLM(仅支持 x86 Linux)。',
'models.search.voxbox.tips': '若需部署音频模型取消勾选 GGUF 复选框。',
' 非 GGUF 的音模型用 vox-box其它非 GGUF 的模型用 vLLM(仅支持 x86 Linux)。',
'models.search.voxbox.tips': '若需部语音模型取消勾选 GGUF 复选框。',
'models.form.ollamalink': '在 Ollama Library 中查找',
'models.form.backend_parameters.llamabox.placeholder':
'例如,--ctx-size=8192',
@ -83,9 +83,9 @@ export default {
'models.form.backend.llamabox':
'用于 GGUF 格式模型,支持 Linux, macOS 和 Windows',
'models.form.backend.vllm': '用于非 GGUF 格式模型,仅支持 x86 Linux',
'models.form.backend.voxbox': '用于非 GGUF 格式的模型',
'models.form.backend.voxbox': '用于非 GGUF 格式的音模型',
'models.form.search.gguftips':
'当 macOS 或 Windows 作 Worker 时勾选 GGUF搜索模型时取消勾选)',
'当 macOS 或 Windows 作 Worker 时勾选 GGUF搜索音模型时取消勾选)',
'models.form.button.addlabel': '添加标签',
'models.filter.category': '按类别筛选',
'models.list.more.logs': '查看更多',

@ -21,8 +21,10 @@ import {
ModelScopeSortType,
ModelSortType,
ModelscopeTaskMap,
backendOptionsMap,
modelSourceMap
} from '../config';
import { identifyModelTask } from '../config/audio-catalog';
import SearchStyle from '../style/search-result.less';
import SearchInput from './search-input';
import SearchResult from './search-result';
@ -204,7 +206,9 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
}
try {
const repoList = list.map((item) => {
const isAuido = identifyModelTask(modelSource, item.name);
return {
...(isAuido ? { backend: backendOptionsMap.voxBox } : {}),
source: modelSource,
...(modelSource === modelSourceMap.huggingface_value
? {

@ -181,21 +181,27 @@ export const ModelScopeModels = [
}
];
const checkModelName = (
modelName: string,
item: { type: string; org: string; name: string }
) => {
let sourceName = `${item.org}/${item.name}`;
if (item.name === '*') {
sourceName = `${item.org}`;
}
return (
`${sourceName}`.indexOf(modelName) > -1 ||
modelName?.indexOf(`${sourceName}`) > -1
);
};
export const identifyModelTask = (source: string, modelName: string) => {
let data = null;
if (source === modelSourceMap.huggingface_value) {
data = HuggingFaceModels.find(
(item) =>
`${item.org}/${item.name}`.indexOf(modelName) > -1 ||
modelName?.indexOf(`${item.org}/${item.name}`) > -1
);
data = HuggingFaceModels.find((item) => checkModelName(modelName, item));
}
if (source === modelSourceMap.modelscope_value) {
data = ModelScopeModels.find(
(item) =>
`${item.org}/${item.name}`.indexOf(modelName) > -1 ||
modelName?.indexOf(`${item.org}/${item.name}`) > -1
);
data = ModelScopeModels.find((item) => checkModelName(modelName, item));
}
if (data) {
return modelTaskMap.audio;

@ -11,11 +11,7 @@ import useBodyScroll from '@/hooks/use-body-scroll';
import useTableFetch from '@/hooks/use-table-fetch';
import { createModel } from '@/pages/llmodels/apis';
import DeployModal from '@/pages/llmodels/components/deploy-modal';
import {
backendOptionsMap,
modelSourceMap,
setSourceRepoConfigValue
} from '@/pages/llmodels/config';
import { backendOptionsMap, modelSourceMap } from '@/pages/llmodels/config';
import { identifyModelTask } from '@/pages/llmodels/config/audio-catalog';
import {
modalConfig,
@ -298,8 +294,6 @@ const ModelFiles = () => {
const targetWorker = _.find(workersList, { value: record.worker_id })
?.labels?.['worker-name'];
const result = setSourceRepoConfigValue(record.source, record);
return {
source: modelSourceMap.local_path_value,
local_path: record.resolved_paths?.[0],

@ -1,3 +1,5 @@
import _ from 'lodash';
export const isNotEmptyValue = (value: any) => {
if (Array.isArray(value)) {
return value.length > 0;
@ -20,25 +22,22 @@ export const handleBatchRequest = async (
};
export const convertFileSize = (
sizeInBytes: number | undefined,
prec?: number,
sizeInBytes?: number,
prec = 1,
allowEmpty = false
) => {
const precision = prec ?? 1;
if (!sizeInBytes) {
return allowEmpty ? '' : '0';
}
if (sizeInBytes < 1024) {
return `${sizeInBytes.toFixed(precision)} B`;
} else if (sizeInBytes < 1024 * 1024) {
return `${(sizeInBytes / 1024).toFixed(precision)} KiB`;
} else if (sizeInBytes < 1024 * 1024 * 1024) {
return `${(sizeInBytes / (1024 * 1024)).toFixed(precision)} MiB`;
} else if (sizeInBytes < 1024 * 1024 * 1024 * 1024) {
return `${(sizeInBytes / (1024 * 1024 * 1024)).toFixed(precision)} GiB`;
} else {
return `${(sizeInBytes / (1024 * 1024 * 1024 * 1024)).toFixed(precision)} TiB`;
): string => {
if (!sizeInBytes) return allowEmpty ? '' : '0';
const units = ['B', 'KiB', 'MiB', 'GiB', 'TiB'];
let size = sizeInBytes;
let unitIndex = 0;
while (size >= 1024 && unitIndex < units.length - 1) {
size /= 1024;
unitIndex++;
}
return `${_.round(size, prec)} ${units[unitIndex]}`;
};
export const platformCall = () => {

Loading…
Cancel
Save