fix: add a button to last page on logs

This commit is contained in:
jialin
2025-01-08 15:26:03 +08:00
parent 2a9c501ee2
commit decb3ef2f1
21 changed files with 245 additions and 127 deletions
@@ -303,7 +303,6 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
{ backend: backendParamsTips.backend || '' }
)}{' '}
<Typography.Link
style={{ color: 'var(--ant-blue-4)' }}
href={backendParamsTips.link}
target="_blank"
>
@@ -125,6 +125,10 @@ const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
return [...shardFileListResult, ...newGeneralFileList];
}, []);
const hfFileFilter = (file: any) => {
return filterRegGGUF.test(file.path) || _.includes(file.path, '.gguf');
};
// hugging face files
const getHuggingfaceFiles = async () => {
try {
@@ -139,7 +143,7 @@ const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
});
const list = _.filter(fileList, (file: any) => {
return filterRegGGUF.test(file.path) || _.includes(file.path, '.gguf');
return hfFileFilter(file);
});
return list;
@@ -148,6 +152,10 @@ const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
}
};
const modelscopeFileFilter = (file: any) => {
return filterRegGGUF.test(file.Path) && file.Type === 'blob';
};
// modelscope files
const getModelScopeFiles = async () => {
try {
@@ -161,7 +169,7 @@ const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
}
);
const fileList = _.filter(_.get(data, ['Data', 'Files']), (file: any) => {
return filterRegGGUF.test(file.Path) && file.Type === 'blob';
return modelscopeFileFilter(file);
});
const list = _.map(fileList, (item: any) => {
@@ -51,6 +51,8 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
url: `${MODELS_API}/${props.modelId}/instances`,
handler: updateHandler
});
} else {
logsViewerRef.current?.abort();
}
return () => {
requestRef.current?.current?.cancel?.();