fix: change benchmark model name query condition to input
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import { modelCategoriesMap } from '@/pages/llmodels/config';
|
|
||||||
import { SearchOutlined } from '@ant-design/icons';
|
import { SearchOutlined } from '@ant-design/icons';
|
||||||
import { BaseSelect, FilterForm } from '@gpustack/core-ui';
|
import { BaseSelect, FilterForm } from '@gpustack/core-ui';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
@@ -23,17 +22,13 @@ interface FilterFormContentProps {
|
|||||||
initialValues?: any;
|
initialValues?: any;
|
||||||
open?: boolean;
|
open?: boolean;
|
||||||
ref?: any;
|
ref?: any;
|
||||||
modelList?: Global.BaseOption<number, { categories: string[] }>[];
|
|
||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
onClear?: () => void;
|
onClear?: () => void;
|
||||||
onValuesChange: (values: any) => void;
|
onValuesChange: (values: any) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FilterFormContent: React.FC<FilterFormContentProps> = forwardRef(
|
const FilterFormContent: React.FC<FilterFormContentProps> = forwardRef(
|
||||||
(
|
({ initialValues, onClose, onClear, onValuesChange, open }, ref) => {
|
||||||
{ initialValues, onClose, onClear, onValuesChange, open, modelList },
|
|
||||||
ref
|
|
||||||
) => {
|
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const filterRef = useRef<any>(null);
|
const filterRef = useRef<any>(null);
|
||||||
|
|
||||||
@@ -41,15 +36,6 @@ const FilterFormContent: React.FC<FilterFormContentProps> = forwardRef(
|
|||||||
onValuesChange?.(allValues);
|
onValuesChange?.(allValues);
|
||||||
};
|
};
|
||||||
|
|
||||||
const modelOptions = modelList
|
|
||||||
?.filter((item) => {
|
|
||||||
return item.categories?.includes(modelCategoriesMap.llm);
|
|
||||||
})
|
|
||||||
.map((item) => ({
|
|
||||||
label: item.label,
|
|
||||||
value: item.label
|
|
||||||
}));
|
|
||||||
|
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
reset: () => {
|
reset: () => {
|
||||||
filterRef.current?.reset();
|
filterRef.current?.reset();
|
||||||
@@ -116,16 +102,17 @@ const FilterFormContent: React.FC<FilterFormContentProps> = forwardRef(
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Label>{intl.formatMessage({ id: 'benchmark.table.model' })}</Label>
|
<Label>{intl.formatMessage({ id: 'benchmark.table.model' })}</Label>
|
||||||
<Form.Item noStyle name="model_name">
|
<Form.Item noStyle name="model_name">
|
||||||
{/* <PillButtonGroup
|
<Input
|
||||||
options={modelCategories.filter((item) => item.value)}
|
prefix={
|
||||||
></PillButtonGroup> */}
|
<SearchOutlined
|
||||||
<BaseSelect
|
style={{ color: 'var(--ant-color-text-placeholder)' }}
|
||||||
allowClear
|
></SearchOutlined>
|
||||||
|
}
|
||||||
placeholder={intl.formatMessage({
|
placeholder={intl.formatMessage({
|
||||||
id: 'benchmark.table.filter.bymodel'
|
id: 'benchmark.table.filter.bymodel'
|
||||||
})}
|
})}
|
||||||
options={modelOptions}
|
allowClear
|
||||||
></BaseSelect>
|
></Input>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Content>
|
</Content>
|
||||||
</FilterForm>
|
</FilterForm>
|
||||||
|
|||||||
Reference in New Issue
Block a user