feat: add cluster detail

This commit is contained in:
jialin
2026-01-09 20:51:48 +08:00
parent 7b5ce83cbd
commit afcd3e5693
32 changed files with 255 additions and 139 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ const Catalog: React.FC = () => {
handleInputChange={handleNameChange}
selectOptions={categoryOptions}
buttonIcon={<SearchOutlined />}
width={{ input: 230, select: 200 }}
widths={{ input: 230, select: 200 }}
></FilterBar>
<ScrollerContext.Provider
value={{
@@ -1,7 +1,6 @@
import { getRequestId } from '@/atoms/models';
import BaseSelect from '@/components/seal-form/base/select';
import SimpleOverlay from '@/components/simple-overlay';
import { createAxiosToken } from '@/hooks/use-chunk-request';
import { useIntl } from '@umijs/max';
import { Empty, Spin } from 'antd';
import _ from 'lodash';
@@ -14,13 +13,8 @@ import React, {
} from 'react';
import 'simplebar-react/dist/simplebar.min.css';
import styled from 'styled-components';
import {
evaluationsModelSpec,
queryHuggingfaceModelFiles,
queryModelScopeModelFiles
} from '../apis';
import { queryHuggingfaceModelFiles, queryModelScopeModelFiles } from '../apis';
import { modelSourceMap } from '../config';
import { backendOptionsMap } from '../config/backend-parameters';
import '../style/hf-model-file.less';
import FileSkeleton from './file-skeleton';
import ModelFileItem from './model-file-item';
@@ -226,70 +220,6 @@ const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
}
};
const getEvaluateResults = async (repoList: any[]) => {
try {
checkTokenRef.current?.cancel?.();
checkTokenRef.current = createAxiosToken();
const evaluations = await evaluationsModelSpec(
{
model_specs: repoList
},
{
token: checkTokenRef.current.token
}
);
return evaluations.results || [];
} catch (error) {
return [];
}
};
const handleEvaluate = async (list: any[]) => {
if (isDownload) {
return;
}
try {
const evaluateFileList = list.map((item: any) => {
// TODO: llamabox is remove from backend options, user should select a available backend
return {
backend: backendOptionsMap.llamaBox,
source: modelSource,
...(modelSource === modelSourceMap.huggingface_value
? {
huggingface_repo_id: props.selectedModel.name,
huggingface_filename: item.fakeName
}
: {
model_scope_model_id: props.selectedModel.name,
model_scope_file_path: item.fakeName
})
};
});
setIsEvaluating(true);
const evaluationList = await getEvaluateResults(evaluateFileList);
const resultList = _.map(list, (item: any, index: number) => {
return {
...item,
evaluateResult: evaluationList[index]
};
});
const currentItem = _.find(
resultList,
(item: any) => item.path === currentPathRef.current
);
if (currentItem) {
onSelectFileAfterEvaluate?.(currentItem);
}
setDataSource({ fileList: resultList, loading: false });
setIsEvaluating(false);
} catch (error) {
setIsEvaluating(false);
}
};
const handleFetchModelFiles = async () => {
if (!props.selectedModel.name) {
setDataSource({ fileList: [], loading: false });