style: usage download button

This commit is contained in:
jialin
2025-06-17 16:17:26 +08:00
parent 0133524f09
commit 0805d70c07
5 changed files with 32 additions and 34 deletions
@@ -196,8 +196,8 @@ const AddModal: FC<AddModalProps> = (props) => {
* unitl the evaluate result is ready
*/
form.current?.setFieldsValue?.({
file_name: item.fakeName,
...modelInfo,
file_name: item.fakeName,
categories: getCategory(item)
});
@@ -233,9 +233,9 @@ const AddModal: FC<AddModalProps> = (props) => {
form.current?.getFieldValue?.('backend_parameters') || [];
form.current?.setFieldsValue?.({
file_name: item.fakeName,
...defaultSpec,
...modelInfo,
file_name: item.fakeName,
backend_parameters:
formBackendParameters.length > 0
? formBackendParameters
@@ -41,10 +41,6 @@ interface HFModelFileProps {
ref: any;
gpuOptions?: any[];
onSelectFile?: (file: any, evaluate?: boolean) => void;
displayEvaluateStatus?: (data: {
show?: boolean;
flag: Record<string, boolean>;
}) => void;
}
const pattern = /^(.*)-(\d+)-of-(\d+)\.(.*)$/;
@@ -54,7 +50,7 @@ const includeReg = /\.(safetensors|gguf)$/i;
const filterRegGGUF = /\.(gguf)$/i;
const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
const { collapsed, modelSource, isDownload, displayEvaluateStatus } = props;
const { collapsed, modelSource, isDownload } = props;
const intl = useIntl();
const [isEvaluating, setIsEvaluating] = useState(false);
const [dataSource, setDataSource] = useState<any>({
@@ -260,12 +256,7 @@ const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
resultList,
(item: any) => item.path === currentPathRef.current
);
displayEvaluateStatus?.({
show: false,
flag: {
file: false
}
});
if (currentItem) {
handleSelectModelFile(currentItem, true);
}
@@ -273,12 +264,6 @@ const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
setIsEvaluating(false);
} catch (error) {
setIsEvaluating(false);
displayEvaluateStatus?.({
show: false,
flag: {
file: false
}
});
}
};