chore: modelscope downloading state

main
jialin 2 years ago
parent 69ffdd4604
commit 458f467985

@ -14,7 +14,7 @@ const isProduction = env === 'production';
const t = Date.now();
export default defineConfig({
proxy: {
...proxy('http://192.168.50.166:8080')
...proxy()
},
history: {
type: 'hash'

@ -52,7 +52,7 @@ const StatusTag: React.FC<StatusTagProps> = ({
const renderContent = () => {
const percent = download?.percent || 0;
if (download && percent > 0 && percent < 100) {
if (download && percent > 0 && percent <= 100) {
return (
<>
<span className="progress">{download?.percent || 0}%</span>

@ -283,7 +283,7 @@ body {
// form item help
.ant-form-item-with-help .ant-form-item-explain {
padding-left: 24px;
padding-left: 16px;
}
// icon
@ -536,6 +536,10 @@ body {
}
}
.rc-virtual-list-scrollbar {
width: var(--scrollbar-size) !important;
}
.ant-dropdown-menu
.ant-dropdown-menu-item.ant-dropdown-menu-item-danger:not(
.ant-dropdown-menu-item-disabled
@ -671,6 +675,10 @@ body {
}
}
.ant-drawer .ant-drawer-title {
font-weight: var(--font-weight-bold);
}
.tooltip-wrapper {
display: flex;
flex-direction: column;

@ -59,5 +59,6 @@ export default {
'models.form.backend': 'Backend',
'models.form.backend_parameters': 'Backend Parameters',
'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_parameters': '后端参数',
'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>
<div>
<Tag
bordered={false}
color="error"
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 SealInput from '@/components/seal-form/seal-input';
import SealSelect from '@/components/seal-form/seal-select';
import { PageAction } from '@/config';
import { PageActionType } from '@/config/types';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import { Form, Tooltip, Typography } from 'antd';
import _ from 'lodash';
import React, {
forwardRef,
@ -222,6 +223,22 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
options={ollamaModelOptions}
label={intl.formatMessage({ id: 'model.form.ollama.model' })}
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
></SealAutoComplete>
</Form.Item>

@ -254,9 +254,17 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
: undefined
}
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],
message: item.state_message
message:
item.state === InstanceStatusMap.Downloading &&
item.download_progress === 100
? ''
: item.state_message
}}
></StatusTag>
)}

@ -16,13 +16,6 @@ export const ollamaModelOptions = [
tags: ['Tools', '0.5B', '1.5B', '3B', '7B', '14B', '32B', '72B'],
id: 'gemma2'
},
{
label: 'llama3.1',
value: 'llama3.1',
name: 'llama3.1',
id: 'llama3.1',
tags: ['8B', '70B', '405B']
},
{
label: 'gemma2',
value: 'gemma2',
@ -30,13 +23,6 @@ export const ollamaModelOptions = [
tags: ['2B', '9B', '27B'],
id: 'gemma2'
},
{
label: 'llava',
value: 'llava',
name: 'llava',
tags: ['7B', '13B', '34B'],
id: 'llava'
},
{
label: 'mistral-nemo',
value: 'mistral-nemo',
@ -58,13 +44,6 @@ export const ollamaModelOptions = [
tags: ['7B'],
id: 'mistral'
},
{
label: 'qwen2',
value: 'qwen2',
name: 'qwen2',
tags: ['0.5B', '1.5B', '7B', '72B'],
id: 'qwen2'
},
{
label: 'phi3.5',
value: 'phi3.5',

Loading…
Cancel
Save