void;
diff --git a/src/global.less b/src/global.less
index 5eaf42c6..2f8277ed 100644
--- a/src/global.less
+++ b/src/global.less
@@ -444,6 +444,16 @@ body {
}
&.user-menu-collapsed {
+ .ant-menu-submenu-title {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ color: var(--color-text-1) !important;
+ padding-inline: unset !important;
+ width: 100%;
+ margin-inline: 0 !important;
+ }
+
.user-avatar.ant-menu-submenu {
.ant-menu-submenu-title {
padding: 0 !important;
diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx
index 90a5d2f6..b999540b 100644
--- a/src/layouts/index.tsx
+++ b/src/layouts/index.tsx
@@ -225,6 +225,9 @@ export default (props: any) => {
layout="side"
disableMobile={true}
siderWidth={220}
+ onCollapse={(collapsed) => {
+ setCollapsed(collapsed);
+ }}
onMenuHeaderClick={(e) => {
e.stopPropagation();
e.preventDefault();
diff --git a/src/layouts/rightRender.tsx b/src/layouts/rightRender.tsx
index ee73d91b..ef48f6a6 100644
--- a/src/layouts/rightRender.tsx
+++ b/src/layouts/rightRender.tsx
@@ -99,11 +99,6 @@ export const getRightRenderContent = (opts: {
icon:
,
label: intl.formatMessage({ id: 'common.button.version' })
}
- // {
- // key: 'shortcuts',
- // icon:
,
- // label: intl.formatMessage({ id: 'common.button.shortcut' })
- // }
];
const helpMenu = {
@@ -113,7 +108,7 @@ export const getRightRenderContent = (opts: {
: 'user-menu-container',
mode: 'vertical',
expandIcon: false,
- inlineCollapsed: collapsed,
+ // inlineCollapsed: collapsed,
triggerSubMenuAction: 'hover',
items: [
{
@@ -163,7 +158,7 @@ export const getRightRenderContent = (opts: {
: 'user-menu-container',
mode: 'vertical',
expandIcon: false,
- inlineCollapsed: collapsed,
+ // inlineCollapsed: collapsed,
triggerSubMenuAction: 'hover',
items: [
{
@@ -196,7 +191,7 @@ export const getRightRenderContent = (opts: {
: 'user-menu-container',
mode: 'vertical',
expandIcon: false,
- inlineCollapsed: collapsed,
+ // inlineCollapsed: collapsed,
triggerSubMenuAction: 'hover',
items: [
{
@@ -263,19 +258,19 @@ export const getRightRenderContent = (opts: {
diff --git a/src/pages/llmodels/components/advance-config.tsx b/src/pages/llmodels/components/advance-config.tsx
index e681534f..91035ff2 100644
--- a/src/pages/llmodels/components/advance-config.tsx
+++ b/src/pages/llmodels/components/advance-config.tsx
@@ -1,22 +1,25 @@
import LabelSelector from '@/components/label-selector';
+import FieldWrapper from '@/components/label-selector/wrapper';
import ListInput from '@/components/list-input';
import SealSelect from '@/components/seal-form/seal-select';
import { PageAction } from '@/config';
import { PageActionType } from '@/config/types';
import { InfoCircleOutlined, RightOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
+
import {
Checkbox,
Collapse,
Form,
FormInstance,
+ Radio,
Select,
Tooltip,
Typography
} from 'antd';
import _ from 'lodash';
import React, { useCallback, useMemo } from 'react';
-import { backendOptionsMap, placementStrategyOptions } from '../config';
+import { backendOptionsMap } from '../config';
import llamaConfig from '../config/llama-config';
import { FormData } from '../config/types';
import vllmConfig from '../config/vllm-config';
@@ -116,7 +119,7 @@ const AdvanceConfig: React.FC
= (props) => {
const children = (
<>
- = (props) => {
value: 'manual'
}
]}
- >
+ > */}
+
+
+
+ {intl.formatMessage({
+ id: 'models.form.scheduletype.auto'
+ })}
+
+
+ {intl.formatMessage({
+ id: 'models.form.scheduletype.manual'
+ })}
+
+
+
{scheduleType === 'auto' && (
<>
name="placement_strategy">
-
+ > */}
+
+
+ Spread
+ Binpack
+
+
name="worker_selector"
@@ -219,7 +250,7 @@ const AdvanceConfig: React.FC = (props) => {
)}
- = (props) => {
}
]}
disabled={action === PageAction.EDIT}
- >
+ > */}
+
+
+
+ llama-box(llama.cpp)
+
+
+ vLLM
+
+
+
name="backend_parameters">
= (props) => {
setGpuOptions(list);
};
- const initFormValue = () => {
- if (action === PageAction.CREATE && open) {
- form.setFieldsValue({
- source: modelSourceMap.huggingface_value,
- replicas: 1
- });
- }
- if (action === PageAction.EDIT && open) {
- const result = setSourceRepoConfigValue(
- props.data?.source || '',
- props.data
- );
+ const initFormValue = useMemo(() => {
+ const result = setSourceRepoConfigValue(
+ props.data?.source || '',
+ props.data
+ );
- form.setFieldsValue({
- ...result.values,
- ..._.omit(props.data, result.omits),
- scheduleType: props.data?.gpu_selector ? 'manual' : 'auto',
- gpu_selector: props.data?.gpu_selector
- ? `${props.data?.gpu_selector.worker_name}-${props.data?.gpu_selector.gpu_name}-${props.data?.gpu_selector.gpu_index}`
- : null
- });
- }
- };
-
- useEffect(() => {
- initFormValue();
- }, [open]);
+ return {
+ ...result.values,
+ ..._.omit(props.data, result.omits),
+ scheduleType: props.data?.gpu_selector ? 'manual' : 'auto',
+ gpu_selector: props.data?.gpu_selector
+ ? `${props.data?.gpu_selector.worker_name}-${props.data?.gpu_selector.gpu_name}-${props.data?.gpu_selector.gpu_index}`
+ : null
+ };
+ }, [props.data]);
useEffect(() => {
setIsGGUF(props.data?.backend === backendOptionsMap.llamaBox);
@@ -306,6 +294,9 @@ const UpdateModal: React.FC = (props) => {
padding: 'var(--ant-modal-content-padding)',
paddingBlock: 0
}}
+ initialValues={{
+ ...initFormValue
+ }}
>
name="name"
diff --git a/src/pages/llmodels/components/view-logs-modal.tsx b/src/pages/llmodels/components/view-logs-modal.tsx
index 8d5b4715..58403729 100644
--- a/src/pages/llmodels/components/view-logs-modal.tsx
+++ b/src/pages/llmodels/components/view-logs-modal.tsx
@@ -41,7 +41,10 @@ const ViewCodeModal: React.FC = (props) => {
- {intl.formatMessage({ id: 'common.button.viewlog' })}
+
+ {' '}
+ {intl.formatMessage({ id: 'common.button.viewlog' })}
+
}
open={open}
diff --git a/src/pages/playground/components/multiple-chat/content-item.tsx b/src/pages/playground/components/multiple-chat/content-item.tsx
index f97be55d..fe36f9e3 100644
--- a/src/pages/playground/components/multiple-chat/content-item.tsx
+++ b/src/pages/playground/components/multiple-chat/content-item.tsx
@@ -119,7 +119,6 @@ const ContentItem: React.FC = ({
const handleUpdateImgList = useCallback(
(list: { uid: number | string; dataUrl: string }[]) => {
- console.log('list===========', data.imgs, list);
updateMessage?.({
role: data.role,
content: data.content,
diff --git a/src/pages/playground/style/content-item.less b/src/pages/playground/style/content-item.less
index 48d27b17..81993696 100644
--- a/src/pages/playground/style/content-item.less
+++ b/src/pages/playground/style/content-item.less
@@ -12,7 +12,6 @@
.role {
position: relative;
- cursor: pointer;
padding: 0 4px;
border-radius: var(--border-radius-mini);
}