fix(style): always display offloads info

This commit is contained in:
jialin
2025-03-14 16:43:36 +08:00
parent ccbc36f991
commit 38ff16f3cd
7 changed files with 72 additions and 29 deletions
+2 -1
View File
@@ -217,8 +217,9 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
return;
}
const isEndwithGGUF = _.endsWith(value, '.gguf');
const isBlobFile = value.split('/').pop().includes('sha256');
let backend = backendOptionsMap.llamaBox;
if (!isEndwithGGUF) {
if (!isEndwithGGUF && !isBlobFile) {
backend = backendOptionsMap.vllm;
}
props.onBackendChange?.(backend);
@@ -81,8 +81,15 @@ const AddModal: React.FC<AddModalProps> = (props) => {
const updateShowWarning = (backend: string) => {
const localPath = form.current?.getFieldValue?.('local_path');
const isBlobFile = localPath?.split('/').pop()?.includes('sha256');
console.log('upateShowWarning', backend, localPath);
if (isBlobFile) {
setWarningStatus({
show: false,
message: ''
});
return;
}
if (source !== modelSourceMap.local_path_value || !localPath) {
return;
@@ -233,7 +240,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
)}
<div style={{ display: 'flex', flex: 1, maxWidth: '100%' }}>
<ColumnWrapper
paddingBottom={warningStatus.show ? 140 : 50}
paddingBottom={warningStatus.show ? 155 : 50}
footer={
<>
{warningStatus.show && (
@@ -364,7 +364,6 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
}
return (
<Tooltip
open
title={
<span className="flex flex-center">
<span>
+14 -3
View File
@@ -98,6 +98,16 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
const updateShowWarning = (backend: string) => {
const localPath = form.getFieldValue?.('local_path');
const isBlobFile = localPath?.split('/').pop()?.includes('sha256');
if (isBlobFile) {
setWarningStatus({
show: false,
message: ''
});
return;
}
if (formData?.source !== modelSourceMap.local_path_value || !localPath) {
return;
}
@@ -132,7 +142,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
}
form.setFieldValue('backend_version', '');
handleSetGPUIds(val);
updateShowWarning(backend);
updateShowWarning(val);
};
const handleOnFocus = () => {
@@ -145,8 +155,9 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
return;
}
const isEndwithGGUF = _.endsWith(value, '.gguf');
const isBlobFile = value.split('/').pop().includes('sha256');
let backend = backendOptionsMap.llamaBox;
if (!isEndwithGGUF) {
if (!isEndwithGGUF || !isBlobFile) {
backend = backendOptionsMap.vllm;
}
handleBackendChange?.(backend);
@@ -419,7 +430,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
>
<ColumnWrapper
maxHeight={550}
paddingBottom={warningStatus.show ? 85 : 0}
paddingBottom={warningStatus.show ? 100 : 0}
footer={
<>
{warningStatus.show && (