| @@ -89,9 +89,17 @@ function BasicInfo({ info, className, runStatus, isInstance = false }: BasicInfo | |||
| label: 'epochs', | |||
| value: info.epochs, | |||
| }, | |||
| { | |||
| label: 'batch_size', | |||
| value: info.batch_size, | |||
| }, | |||
| ]; | |||
| const lossInfo = [ | |||
| { | |||
| label: '学习率', | |||
| value: info.lr, | |||
| }, | |||
| { | |||
| label: 'loss文件路径', | |||
| value: info.loss_py, | |||
| @@ -100,10 +108,6 @@ function BasicInfo({ info, className, runStatus, isInstance = false }: BasicInfo | |||
| label: 'loss类名', | |||
| value: info.loss_class_name, | |||
| }, | |||
| { | |||
| label: '学习率', | |||
| value: info.lr, | |||
| }, | |||
| ]; | |||
| const algorithmInfo = [ | |||
| @@ -130,12 +134,6 @@ function BasicInfo({ info, className, runStatus, isInstance = false }: BasicInfo | |||
| value: info.task_type, | |||
| format: formatEnum(autoMLTaskTypeOptions), | |||
| }, | |||
| { | |||
| label: '框架类型', | |||
| value: info.framework_type, | |||
| format: formatEnum(frameworkTypeOptions), | |||
| }, | |||
| ...diffInfo, | |||
| { | |||
| label: '代码配置', | |||
| value: info.code_config, | |||
| @@ -164,6 +162,12 @@ function BasicInfo({ info, className, runStatus, isInstance = false }: BasicInfo | |||
| value: info.computing_resource_id, | |||
| format: getResourceDescription, | |||
| }, | |||
| { | |||
| label: '框架类型', | |||
| value: info.framework_type, | |||
| format: formatEnum(frameworkTypeOptions), | |||
| }, | |||
| ...diffInfo, | |||
| { | |||
| label: '是否打乱', | |||
| value: info.shuffle, | |||
| @@ -198,10 +202,6 @@ function BasicInfo({ info, className, runStatus, isInstance = false }: BasicInfo | |||
| label: '检查点轮数', | |||
| value: info.checkpoint_num, | |||
| }, | |||
| { | |||
| label: 'batch_size', | |||
| value: info.batch_size, | |||
| }, | |||
| ]; | |||
| }, [info, getResourceDescription]); | |||
| @@ -40,6 +40,120 @@ function ExecuteConfig() { | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="代码配置" | |||
| name="code_config" | |||
| rules={[ | |||
| { | |||
| validator: requiredValidator, | |||
| message: '请选择代码配置', | |||
| }, | |||
| ]} | |||
| required | |||
| > | |||
| <CodeSelect placeholder="请选择代码配置" canInput={false} size="large" /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="数据集" | |||
| name="dataset" | |||
| rules={[ | |||
| { | |||
| validator: requiredValidator, | |||
| message: '请选择数据集', | |||
| }, | |||
| ]} | |||
| required | |||
| > | |||
| <ResourceSelect | |||
| type={ResourceSelectorType.Dataset} | |||
| placeholder="请选择数据集" | |||
| canInput={false} | |||
| size="large" | |||
| /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="数据集处理文件路径" | |||
| name="dataset_py" | |||
| rules={[ | |||
| { | |||
| required: true, | |||
| message: '请输入数据集处理文件路径', | |||
| }, | |||
| ]} | |||
| > | |||
| <Input placeholder="请输入数据集处理文件路径" maxLength={64} showCount allowClear /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="数据集类名" | |||
| name="dataset_class_name" | |||
| rules={[ | |||
| { | |||
| required: true, | |||
| message: '请输入数据集类名', | |||
| }, | |||
| ]} | |||
| > | |||
| <Input placeholder="请输入数据集类名" maxLength={64} showCount allowClear /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="镜像" | |||
| name="image" | |||
| rules={[ | |||
| { | |||
| validator: requiredValidator, | |||
| message: '请选择镜像', | |||
| }, | |||
| ]} | |||
| required | |||
| > | |||
| <ResourceSelect | |||
| type={ResourceSelectorType.Mirror} | |||
| placeholder="请选择镜像" | |||
| canInput={false} | |||
| /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="资源规格" | |||
| name="computing_resource_id" | |||
| rules={[ | |||
| { | |||
| required: true, | |||
| message: '请选择资源规格', | |||
| }, | |||
| ]} | |||
| > | |||
| <ParameterSelect dataType="resource" placeholder="请选择资源规格" /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| @@ -113,6 +227,22 @@ function ExecuteConfig() { | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="batch_size" | |||
| name="batch_size" | |||
| rules={[ | |||
| { | |||
| required: true, | |||
| message: '请输入 batch_size', | |||
| }, | |||
| ]} | |||
| > | |||
| <InputNumber placeholder="请输入 batch_size" min={0} precision={0} /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| @@ -131,6 +261,22 @@ function ExecuteConfig() { | |||
| </Row> | |||
| {frameworkType === FrameworkType.Pytorch ? ( | |||
| <> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="学习率" | |||
| name="lr" | |||
| rules={[ | |||
| { | |||
| required: true, | |||
| message: '请输入学习率', | |||
| }, | |||
| ]} | |||
| > | |||
| <InputNumber placeholder="请输入学习率" min={0} /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| @@ -173,22 +319,6 @@ function ExecuteConfig() { | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="学习率" | |||
| name="lr" | |||
| rules={[ | |||
| { | |||
| required: true, | |||
| message: '请输入学习率', | |||
| }, | |||
| ]} | |||
| > | |||
| <InputNumber placeholder="请输入学习率" min={0} /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| </> | |||
| ) : null} | |||
| </> | |||
| @@ -255,75 +385,8 @@ function ExecuteConfig() { | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="代码配置" | |||
| name="code_config" | |||
| rules={[ | |||
| { | |||
| validator: requiredValidator, | |||
| message: '请选择代码配置', | |||
| }, | |||
| ]} | |||
| required | |||
| > | |||
| <CodeSelect placeholder="请选择代码配置" canInput={false} size="large" /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="数据集" | |||
| name="dataset" | |||
| rules={[ | |||
| { | |||
| validator: requiredValidator, | |||
| message: '请选择数据集', | |||
| }, | |||
| ]} | |||
| required | |||
| > | |||
| <ResourceSelect | |||
| type={ResourceSelectorType.Dataset} | |||
| placeholder="请选择数据集" | |||
| canInput={false} | |||
| size="large" | |||
| /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="数据集处理文件路径" | |||
| name="dataset_py" | |||
| rules={[ | |||
| { | |||
| required: true, | |||
| message: '请输入数据集处理文件路径', | |||
| }, | |||
| ]} | |||
| > | |||
| <Input placeholder="请输入数据集处理文件路径" maxLength={64} showCount allowClear /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="数据集类名" | |||
| name="dataset_class_name" | |||
| rules={[ | |||
| { | |||
| required: true, | |||
| message: '请输入数据集类名', | |||
| }, | |||
| ]} | |||
| > | |||
| <Input placeholder="请输入数据集类名" maxLength={64} showCount allowClear /> | |||
| <Form.Item label="是否随机打乱" name="shuffle" valuePropName="checked"> | |||
| <Switch /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| @@ -345,53 +408,6 @@ function ExecuteConfig() { | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="镜像" | |||
| name="image" | |||
| rules={[ | |||
| { | |||
| validator: requiredValidator, | |||
| message: '请选择镜像', | |||
| }, | |||
| ]} | |||
| required | |||
| > | |||
| <ResourceSelect | |||
| type={ResourceSelectorType.Mirror} | |||
| placeholder="请选择镜像" | |||
| canInput={false} | |||
| /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="资源规格" | |||
| name="computing_resource_id" | |||
| rules={[ | |||
| { | |||
| required: true, | |||
| message: '请选择资源规格', | |||
| }, | |||
| ]} | |||
| > | |||
| <ParameterSelect dataType="resource" placeholder="请选择资源规格" /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item label="是否随机打乱" name="shuffle" valuePropName="checked"> | |||
| <Switch /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| @@ -494,23 +510,6 @@ function ExecuteConfig() { | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| <Row gutter={8}> | |||
| <Col span={10}> | |||
| <Form.Item | |||
| label="batch_size" | |||
| name="batch_size" | |||
| rules={[ | |||
| { | |||
| required: true, | |||
| message: '请输入 batch_size', | |||
| }, | |||
| ]} | |||
| > | |||
| <InputNumber placeholder="请输入 batch_size" min={0} precision={0} /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| </> | |||
| ); | |||
| } | |||
| @@ -305,7 +305,7 @@ function ExecuteConfig() { | |||
| name="max_models_on_disc" | |||
| tooltip="定义在磁盘中保存的模型的最大数量。额外的模型数量将被永久删除,它设置了一个集成可以使用多少个模型的上限。必须是大于等于1的整数,默认50" | |||
| > | |||
| <InputNumber placeholder="请输入最大数量" min={0} precision={0} /> | |||
| <InputNumber placeholder="请输入最大数量" min={1} precision={0} /> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| @@ -93,7 +93,7 @@ function ExperimentHistory({ calcMetrics, fileUrl, isClassification }: Experimen | |||
| title: '状态', | |||
| dataIndex: 'status', | |||
| key: 'status', | |||
| width: 120, | |||
| width: 150, | |||
| render: TrialStatusCell, | |||
| }, | |||
| ]; | |||
| @@ -357,7 +357,7 @@ function ExperimentList({ type }: ExperimentListProps) { | |||
| return ( | |||
| <div className={styles['experiment-list']}> | |||
| <PageTitle title={config.title}></PageTitle> | |||
| <PageTitle title={config.title + '实验列表'}></PageTitle> | |||
| <div className={styles['experiment-list__content']}> | |||
| <div className={styles['experiment-list__content__filter']}> | |||
| <Input.Search | |||
| @@ -40,6 +40,11 @@ export const statusInfo: Record<AutoMLTrailStatus, ExperimentStatusInfo> = { | |||
| color: themes.textColor, | |||
| icon: '/assets/images/experiment-status/omitted-icon.png', | |||
| }, | |||
| [AutoMLTrailStatus.MEMOUT]: { | |||
| label: '内存溢出', | |||
| color: themes.errorColor, | |||
| icon: '/assets/images/experiment-status/fail-icon.png', | |||
| }, | |||
| }; | |||
| function TrialStatusCell(status?: AutoMLTrailStatus | null) { | |||
| @@ -58,7 +63,7 @@ function TrialStatusCell(status?: AutoMLTrailStatus | null) { | |||
| style={{ color: statusInfo[status] ? statusInfo[status].color : themes.textColor }} | |||
| className={styles['trial-status-cell__label']} | |||
| > | |||
| {statusInfo[status] ? statusInfo[status].label : status} | |||
| {statusInfo[status] ? statusInfo[status].label : '未知'} | |||
| </span> | |||
| </div> | |||
| ); | |||
| @@ -36,7 +36,7 @@ interface VersionCompareModalProps extends Omit<ModalProps, 'onOk'> { | |||
| repo_id: number; | |||
| } | |||
| const formatDataset = (datasets?: DatasetData[]) => { | |||
| const formatDatasets = (datasets?: DatasetData[]) => { | |||
| if (!datasets || datasets.length === 0) { | |||
| return undefined; | |||
| } | |||
| @@ -105,12 +105,12 @@ function VersionCompareModal({ | |||
| { | |||
| key: 'train_datasets', | |||
| text: '训练数据集', | |||
| format: formatDataset, | |||
| format: formatDatasets, | |||
| }, | |||
| { | |||
| key: 'test_datasets', | |||
| text: '测试数据集', | |||
| format: formatDataset, | |||
| format: formatDatasets, | |||
| }, | |||
| { | |||
| key: 'model_source', | |||
| @@ -3,7 +3,7 @@ import { ServiceRunStatus } from '@/enums'; | |||
| import { useComputingResource } from '@/hooks/useComputingResource'; | |||
| import { ServiceVersionData } from '@/pages/ModelDeployment/types'; | |||
| import { formatDate } from '@/utils/date'; | |||
| import { formatCodeConfig, formatModel } from '@/utils/format'; | |||
| import { formatCodeConfig, formatMirror, formatModel } from '@/utils/format'; | |||
| import { Flex } from 'antd'; | |||
| import ModelDeployStatusCell from '../ModelDeployStatusCell'; | |||
| @@ -55,6 +55,7 @@ function VersionBasicInfo({ info }: BasicInfoProps) { | |||
| { | |||
| label: '镜像', | |||
| value: info?.image, | |||
| format: formatMirror, | |||
| }, | |||
| { | |||
| label: '状态', | |||
| @@ -60,6 +60,9 @@ function VersionCompareModal({ version1, version2, ...rest }: VersionCompareModa | |||
| { | |||
| key: 'image', | |||
| text: '镜像', | |||
| format: (data: any) => { | |||
| return data?.path; | |||
| }, | |||
| }, | |||
| { | |||
| key: 'code_config', | |||
| @@ -3,7 +3,7 @@ import { ExperimentStatus, experimentStatusInfo } from '@/pages/Experiment/statu | |||
| import { ExperimentInstance } from '@/types'; | |||
| import { elapsedTime, formatDate } from '@/utils/date'; | |||
| import { useNavigate } from '@umijs/max'; | |||
| import { Button } from 'antd'; | |||
| import { Button, Empty } from 'antd'; | |||
| import styles from './index.less'; | |||
| type ExperimentTableProps = { | |||
| tableData: ExperimentInstance[]; | |||
| @@ -24,33 +24,40 @@ function ExperimentTable({ tableData = [], style }: ExperimentTableProps) { | |||
| <div className={styles['experiment-table__date']}>开始时间</div> | |||
| <div className={styles['experiment-table__operation']}>操作</div> | |||
| </div> | |||
| {tableData?.map((item) => ( | |||
| <div className={styles['experiment-table__content']} key={item.id}> | |||
| <div className={styles['experiment-table__status']} style={{ paddingLeft: '6.5px' }}> | |||
| <img | |||
| src={experimentStatusInfo[item.status as ExperimentStatus]?.icon} | |||
| width={17} | |||
| height={17} | |||
| draggable={false} | |||
| alt="" | |||
| /> | |||
| {Array.isArray(tableData) && tableData.length > 0 ? ( | |||
| tableData.map((item) => ( | |||
| <div className={styles['experiment-table__content']} key={item.id}> | |||
| <div className={styles['experiment-table__status']} style={{ paddingLeft: '6.5px' }}> | |||
| <img | |||
| src={experimentStatusInfo[item.status as ExperimentStatus]?.icon} | |||
| width={17} | |||
| height={17} | |||
| draggable={false} | |||
| alt="" | |||
| /> | |||
| </div> | |||
| <div className={styles['experiment-table__duration']}> | |||
| {elapsedTime(item.create_time, item.finish_time)} | |||
| </div> | |||
| <div className={styles['experiment-table__date']}>{formatDate(item.create_time)}</div> | |||
| <div className={styles['experiment-table__operation']}> | |||
| <Button | |||
| size="small" | |||
| type="link" | |||
| icon={<KFIcon type="icon-xiangqing2" font={14} />} | |||
| onClick={() => gotoExperiment(item)} | |||
| > | |||
| 详情 | |||
| </Button> | |||
| </div> | |||
| </div> | |||
| <div className={styles['experiment-table__duration']}> | |||
| {elapsedTime(item.create_time, item.finish_time)} | |||
| </div> | |||
| <div className={styles['experiment-table__date']}>{formatDate(item.create_time)}</div> | |||
| <div className={styles['experiment-table__operation']}> | |||
| <Button | |||
| size="small" | |||
| type="link" | |||
| icon={<KFIcon type="icon-xiangqing2" font={14} />} | |||
| onClick={() => gotoExperiment(item)} | |||
| > | |||
| 详情 | |||
| </Button> | |||
| </div> | |||
| </div> | |||
| ))} | |||
| )) | |||
| ) : ( | |||
| <Empty | |||
| image={Empty.PRESENTED_IMAGE_SIMPLE} | |||
| imageStyle={{ height: '40px', marginTop: '-10px' }} | |||
| /> | |||
| )} | |||
| </div> | |||
| ); | |||
| } | |||
| @@ -91,10 +91,3 @@ export function downloadCommonFile(url: string, type: string, fileName: string = | |||
| resolveBlob(res, type, fileName); | |||
| }); | |||
| } | |||
| /** | |||
| * @deprecated 无效 | |||
| */ | |||
| export function download(fileName: string) { | |||
| window.location.href = `/api/common/download?fileName=${encodeURI(fileName)}&delete=${true}`; | |||
| } | |||
| @@ -30,7 +30,7 @@ export const formatDatasets = (datasets?: DatasetData[]): BasicInfoLink[] | unde | |||
| return undefined; | |||
| } | |||
| return datasets.map((item) => ({ | |||
| value: item.name, | |||
| value: `${item.name}:${item.version}`, | |||
| link: `/dataset/dataset/info/${item.id}?tab=${ResourceInfoTabKeys.Introduction}&version=${item.version}&name=${item.name}&owner=${item.owner}&identifier=${item.identifier}`, | |||
| })); | |||
| }; | |||
| @@ -46,7 +46,7 @@ export const formatDataset = (dataset?: DatasetData): BasicInfoLink | undefined | |||
| return undefined; | |||
| } | |||
| return { | |||
| value: dataset.name, | |||
| value: `${dataset.name}:${dataset.version}`, | |||
| link: `/dataset/dataset/info/${dataset.id}?tab=${ResourceInfoTabKeys.Introduction}&version=${dataset.version}&name=${dataset.name}&owner=${dataset.owner}&identifier=${dataset.identifier}`, | |||
| }; | |||
| }; | |||
| @@ -62,7 +62,7 @@ export const formatModel = (model: ModelData): BasicInfoLink | undefined => { | |||
| return undefined; | |||
| } | |||
| return { | |||
| value: model.name, | |||
| value: `${model.name}:${model.version}`, | |||
| link: `/dataset/model/info/${model.id}?tab=${ResourceInfoTabKeys.Introduction}&version=${model.version}&name=${model.name}&owner=${model.owner}&identifier=${model.identifier}`, | |||
| }; | |||
| }; | |||