chore: set source as local_path deploy from model files

This commit is contained in:
jialin
2025-03-25 21:24:03 +08:00
parent 8f6c1d0e47
commit 3bc10291c4
8 changed files with 28 additions and 17 deletions
@@ -236,6 +236,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
]}
>
<SealAutoComplete
allowClear
filterOption
defaultActiveFirstOption
disabled={false}
@@ -280,6 +281,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
]}
>
<SealAutoComplete
allowClear
required
filterOption
defaultActiveFirstOption
+3 -2
View File
@@ -23,7 +23,8 @@ const icons = {
HF: React.createElement(IconFont, { type: 'icon-huggingface' }),
Ollama: React.createElement(IconFont, { type: 'icon-ollama' }),
ModelScope: React.createElement(IconFont, { type: 'icon-tu2' }),
LocalPath: React.createElement(IconFont, { type: 'icon-hard-disk' })
LocalPath: React.createElement(IconFont, { type: 'icon-hard-disk' }),
Launch: React.createElement(IconFont, { type: 'icon-rocket-launch' })
};
export const modalConfig: Record<
@@ -192,7 +193,7 @@ export const modelFileActions = [
{
label: 'common.button.deploy',
key: 'deploy',
icon: icons.ThunderboltOutlined
icon: icons.Launch
},
{
label: 'resources.modelfiles.retry.download',
+12 -2
View File
@@ -2,12 +2,19 @@ import IconFont from '@/components/icon-font';
import SealAutoComplete from '@/components/seal-form/auto-complete';
import SealInput from '@/components/seal-form/seal-input';
import SealSelect from '@/components/seal-form/seal-select';
import TooltipList from '@/components/tooltip-list';
import useAppUtils from '@/hooks/use-app-utils';
import { ModelFileFormData as FormData } from '@/pages/resources/config/types';
import { useIntl } from '@umijs/max';
import { Form, Typography } from 'antd';
import _ from 'lodash';
import React, { forwardRef, useImperativeHandle, useMemo } from 'react';
import { modelSourceMap, ollamaModelOptions, sourceOptions } from '../config';
import {
localPathTipsList,
modelSourceMap,
ollamaModelOptions,
sourceOptions
} from '../config';
interface TargetFormProps {
ref?: any;
@@ -27,7 +34,8 @@ const TargetForm: React.FC<TargetFormProps> = forwardRef((props, ref) => {
}));
const handleOk = (values: any) => {
onOk(values);
const data = _.pickBy(values, (val: string) => val);
onOk(data);
};
const renderLocalPathFields = () => {
@@ -46,6 +54,7 @@ const TargetForm: React.FC<TargetFormProps> = forwardRef((props, ref) => {
<SealInput.Input
required
label={intl.formatMessage({ id: 'models.form.filePath' })}
description={<TooltipList list={localPathTipsList}></TooltipList>}
></SealInput.Input>
</Form.Item>
</>
@@ -66,6 +75,7 @@ const TargetForm: React.FC<TargetFormProps> = forwardRef((props, ref) => {
]}
>
<SealAutoComplete
allowClear
filterOption
defaultActiveFirstOption
disabled={false}