chore: modelscope downloading state
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ const isProduction = env === 'production';
|
|||||||
const t = Date.now();
|
const t = Date.now();
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
proxy: {
|
proxy: {
|
||||||
...proxy('http://192.168.50.166:8080')
|
...proxy()
|
||||||
},
|
},
|
||||||
history: {
|
history: {
|
||||||
type: 'hash'
|
type: 'hash'
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ const StatusTag: React.FC<StatusTagProps> = ({
|
|||||||
const renderContent = () => {
|
const renderContent = () => {
|
||||||
const percent = download?.percent || 0;
|
const percent = download?.percent || 0;
|
||||||
|
|
||||||
if (download && percent > 0 && percent < 100) {
|
if (download && percent > 0 && percent <= 100) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<span className="progress">{download?.percent || 0}%</span>
|
<span className="progress">{download?.percent || 0}%</span>
|
||||||
|
|||||||
+9
-1
@@ -283,7 +283,7 @@ body {
|
|||||||
|
|
||||||
// form item help
|
// form item help
|
||||||
.ant-form-item-with-help .ant-form-item-explain {
|
.ant-form-item-with-help .ant-form-item-explain {
|
||||||
padding-left: 24px;
|
padding-left: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// icon
|
// icon
|
||||||
@@ -536,6 +536,10 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.rc-virtual-list-scrollbar {
|
||||||
|
width: var(--scrollbar-size) !important;
|
||||||
|
}
|
||||||
|
|
||||||
.ant-dropdown-menu
|
.ant-dropdown-menu
|
||||||
.ant-dropdown-menu-item.ant-dropdown-menu-item-danger:not(
|
.ant-dropdown-menu-item.ant-dropdown-menu-item-danger:not(
|
||||||
.ant-dropdown-menu-item-disabled
|
.ant-dropdown-menu-item-disabled
|
||||||
@@ -671,6 +675,10 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ant-drawer .ant-drawer-title {
|
||||||
|
font-weight: var(--font-weight-bold);
|
||||||
|
}
|
||||||
|
|
||||||
.tooltip-wrapper {
|
.tooltip-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -59,5 +59,6 @@ export default {
|
|||||||
'models.form.backend': 'Backend',
|
'models.form.backend': 'Backend',
|
||||||
'models.form.backend_parameters': 'Backend Parameters',
|
'models.form.backend_parameters': 'Backend Parameters',
|
||||||
'models.search.gguf.tips': '1. GGUF model backend is llama-box(llama.cpp).',
|
'models.search.gguf.tips': '1. GGUF model backend is llama-box(llama.cpp).',
|
||||||
'models.search.vllm.tips': '2. Non-GGUF model backend is vLLM.'
|
'models.search.vllm.tips': '2. Non-GGUF model backend is vLLM.',
|
||||||
|
'models.form.ollamalink': 'Find More in Ollama Library'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -58,5 +58,6 @@ export default {
|
|||||||
'models.form.backend': '后端',
|
'models.form.backend': '后端',
|
||||||
'models.form.backend_parameters': '后端参数',
|
'models.form.backend_parameters': '后端参数',
|
||||||
'models.search.gguf.tips': '1. GGUF 模型后端为 llama-box(llama.cpp)',
|
'models.search.gguf.tips': '1. GGUF 模型后端为 llama-box(llama.cpp)',
|
||||||
'models.search.vllm.tips': '2. 非 GGUF 模型后端为 vLLM'
|
'models.search.vllm.tips': '2. 非 GGUF 模型后端为 vLLM',
|
||||||
|
'models.form.ollamalink': '在 Ollama Library 中查找'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ const AddModal: React.FC<AddModalProps> = ({
|
|||||||
<Form.Item>
|
<Form.Item>
|
||||||
<div>
|
<div>
|
||||||
<Tag
|
<Tag
|
||||||
|
bordered={false}
|
||||||
color="error"
|
color="error"
|
||||||
style={{ padding: '6px 8px', marginBottom: 16 }}
|
style={{ padding: '6px 8px', marginBottom: 16 }}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
|
import IconFont from '@/components/icon-font';
|
||||||
import SealAutoComplete from '@/components/seal-form/auto-complete';
|
import SealAutoComplete from '@/components/seal-form/auto-complete';
|
||||||
import SealInput from '@/components/seal-form/seal-input';
|
import SealInput from '@/components/seal-form/seal-input';
|
||||||
import SealSelect from '@/components/seal-form/seal-select';
|
import SealSelect from '@/components/seal-form/seal-select';
|
||||||
import { PageAction } from '@/config';
|
import { PageAction } from '@/config';
|
||||||
import { PageActionType } from '@/config/types';
|
import { PageActionType } from '@/config/types';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Form } from 'antd';
|
import { Form, Tooltip, Typography } from 'antd';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import React, {
|
import React, {
|
||||||
forwardRef,
|
forwardRef,
|
||||||
@@ -222,6 +223,22 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
|||||||
options={ollamaModelOptions}
|
options={ollamaModelOptions}
|
||||||
label={intl.formatMessage({ id: 'model.form.ollama.model' })}
|
label={intl.formatMessage({ id: 'model.form.ollama.model' })}
|
||||||
placeholder={intl.formatMessage({ id: 'model.form.ollamaholder' })}
|
placeholder={intl.formatMessage({ id: 'model.form.ollamaholder' })}
|
||||||
|
addAfter={
|
||||||
|
<Typography.Link
|
||||||
|
href="https://www.ollama.com/library"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
<Tooltip
|
||||||
|
title={intl.formatMessage({ id: 'models.form.ollamalink' })}
|
||||||
|
placement="topRight"
|
||||||
|
>
|
||||||
|
<IconFont
|
||||||
|
type="icon-external-link"
|
||||||
|
className="font-size-14"
|
||||||
|
></IconFont>
|
||||||
|
</Tooltip>
|
||||||
|
</Typography.Link>
|
||||||
|
}
|
||||||
required
|
required
|
||||||
></SealAutoComplete>
|
></SealAutoComplete>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
@@ -254,9 +254,17 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
statusValue={{
|
statusValue={{
|
||||||
status: status[item.state] as any,
|
status:
|
||||||
|
item.state === InstanceStatusMap.Downloading &&
|
||||||
|
item.download_progress === 100
|
||||||
|
? status[InstanceStatusMap.Running]
|
||||||
|
: (status[item.state] as any),
|
||||||
text: InstanceStatusMapValue[item.state],
|
text: InstanceStatusMapValue[item.state],
|
||||||
message: item.state_message
|
message:
|
||||||
|
item.state === InstanceStatusMap.Downloading &&
|
||||||
|
item.download_progress === 100
|
||||||
|
? ''
|
||||||
|
: item.state_message
|
||||||
}}
|
}}
|
||||||
></StatusTag>
|
></StatusTag>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -16,13 +16,6 @@ export const ollamaModelOptions = [
|
|||||||
tags: ['Tools', '0.5B', '1.5B', '3B', '7B', '14B', '32B', '72B'],
|
tags: ['Tools', '0.5B', '1.5B', '3B', '7B', '14B', '32B', '72B'],
|
||||||
id: 'gemma2'
|
id: 'gemma2'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: 'llama3.1',
|
|
||||||
value: 'llama3.1',
|
|
||||||
name: 'llama3.1',
|
|
||||||
id: 'llama3.1',
|
|
||||||
tags: ['8B', '70B', '405B']
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: 'gemma2',
|
label: 'gemma2',
|
||||||
value: 'gemma2',
|
value: 'gemma2',
|
||||||
@@ -30,13 +23,6 @@ export const ollamaModelOptions = [
|
|||||||
tags: ['2B', '9B', '27B'],
|
tags: ['2B', '9B', '27B'],
|
||||||
id: 'gemma2'
|
id: 'gemma2'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: 'llava',
|
|
||||||
value: 'llava',
|
|
||||||
name: 'llava',
|
|
||||||
tags: ['7B', '13B', '34B'],
|
|
||||||
id: 'llava'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: 'mistral-nemo',
|
label: 'mistral-nemo',
|
||||||
value: 'mistral-nemo',
|
value: 'mistral-nemo',
|
||||||
@@ -58,13 +44,6 @@ export const ollamaModelOptions = [
|
|||||||
tags: ['7B'],
|
tags: ['7B'],
|
||||||
id: 'mistral'
|
id: 'mistral'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: 'qwen2',
|
|
||||||
value: 'qwen2',
|
|
||||||
name: 'qwen2',
|
|
||||||
tags: ['0.5B', '1.5B', '7B', '72B'],
|
|
||||||
id: 'qwen2'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: 'phi3.5',
|
label: 'phi3.5',
|
||||||
value: 'phi3.5',
|
value: 'phi3.5',
|
||||||
|
|||||||
Reference in New Issue
Block a user