chore: deploy model from local path

This commit is contained in:
jialin
2024-11-07 17:35:07 +08:00
parent 8bc67b323c
commit 93a6a77c2b
15 changed files with 270 additions and 77 deletions
+12 -2
View File
@@ -5,7 +5,7 @@ import { useIntl } from '@umijs/max';
import { Button, Drawer } from 'antd';
import { debounce } from 'lodash';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
import { modelSourceMap } from '../config';
import { backendOptionsMap, modelSourceMap } from '../config';
import { FormData, ListItem } from '../config/types';
import ColumnWrapper from './column-wrapper';
import DataForm from './data-form';
@@ -27,7 +27,6 @@ type AddModalProps = {
};
const AddModal: React.FC<AddModalProps> = (props) => {
console.log('addmodel====');
const {
title,
open,
@@ -72,6 +71,16 @@ const AddModal: React.FC<AddModalProps> = (props) => {
}
};
const handleBackendChange = (backend: string) => {
if (backend === backendOptionsMap.vllm) {
setIsGGUF(false);
}
if (backend === backendOptionsMap.llamaBox) {
setIsGGUF(true);
}
};
useEffect(() => {
handleSelectModelFile({ fakeName: '' });
}, [selectedModel]);
@@ -188,6 +197,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
onOk={onOk}
ref={form}
isGGUF={isGGUF}
onBackendChange={handleBackendChange}
></DataForm>
</>
</ColumnWrapper>