fix: benchmark detail styles
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { PageAction } from '@/config';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
@@ -31,16 +30,6 @@ const DatasetForm: React.FC = () => {
|
||||
cancelRequest: cancelProfilesRequest
|
||||
} = useQueryProfiles();
|
||||
|
||||
const handleOnDataSetChange = (value: any, option: any) => {
|
||||
form.setFieldsValue({
|
||||
dataset_id: option?.data?.id,
|
||||
dataset_prompt_tokens: option?.prompt_tokens,
|
||||
dataset_output_tokens: option?.output_tokens,
|
||||
request_rate: null,
|
||||
total_requests: null
|
||||
});
|
||||
};
|
||||
|
||||
const handleProfileChange = (value: string, option: any) => {
|
||||
if (value !== ProfileValueMap.Custom) {
|
||||
const dataset_id = datasetList.find(
|
||||
@@ -86,13 +75,9 @@ const DatasetForm: React.FC = () => {
|
||||
></SealSelect>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<FormData> hidden name="dataset_id">
|
||||
<SealInput.Input></SealInput.Input>
|
||||
</Form.Item>
|
||||
<RandomSettingsForm
|
||||
datasetList={datasetList}
|
||||
datasetLoading={datasetLoading}
|
||||
handleOnDataSetChange={handleOnDataSetChange}
|
||||
></RandomSettingsForm>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -93,19 +93,6 @@ const ProviderForm: React.FC<ProviderFormProps> = forwardRef((props, ref) => {
|
||||
}
|
||||
}, [showAdvanced, activeKey]);
|
||||
|
||||
// const advancedItems = showAdvanced
|
||||
// ? [
|
||||
// {
|
||||
// key: TABKeysMap.ADVANCED,
|
||||
// label: intl.formatMessage({ id: 'resources.form.advanced' }),
|
||||
// forceRender: true,
|
||||
// children: <RandomSettingsForm />
|
||||
// }
|
||||
// ]
|
||||
// : [];
|
||||
|
||||
console.log('render form with profile:', showAdvanced);
|
||||
|
||||
return (
|
||||
<ScrollSpyTabs
|
||||
ref={scrollTabsRef}
|
||||
@@ -129,7 +116,7 @@ const ProviderForm: React.FC<ProviderFormProps> = forwardRef((props, ref) => {
|
||||
form={form}
|
||||
onFinish={onFinish}
|
||||
initialValues={{
|
||||
dataset_prompt_tokens: null,
|
||||
dataset_input_tokens: null,
|
||||
dataset_output_tokens: null,
|
||||
total_requests: null,
|
||||
request_rate: null,
|
||||
|
||||
@@ -101,6 +101,10 @@ const ModelInstanceForm: React.FC = () => {
|
||||
children: []
|
||||
}));
|
||||
|
||||
if (modelOptions.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// preload instances for the first model
|
||||
const instanceList = await fetchInstanceList({ id: modelOptions[0]?.id });
|
||||
const instanceOptions = instanceList.map((instance: any) =>
|
||||
|
||||
@@ -11,9 +11,8 @@ import { FormData } from '../config/types';
|
||||
const RandomSettingsForm: React.FC<{
|
||||
datasetList: Global.BaseOption<number | string>[];
|
||||
datasetLoading: boolean;
|
||||
handleOnDataSetChange: (value: any, option: any) => void;
|
||||
}> = (props) => {
|
||||
const { datasetList, datasetLoading, handleOnDataSetChange } = props;
|
||||
const { datasetList, datasetLoading } = props;
|
||||
const intl = useIntl();
|
||||
const { action, open } = useFormContext();
|
||||
const form = Form.useFormInstance();
|
||||
@@ -45,13 +44,12 @@ const RandomSettingsForm: React.FC<{
|
||||
value: item.label
|
||||
}))}
|
||||
loading={datasetLoading}
|
||||
onChange={handleOnDataSetChange}
|
||||
label={intl.formatMessage({ id: 'benchmark.table.dataset' })}
|
||||
required
|
||||
></SealSelect>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="dataset_prompt_tokens"
|
||||
name="dataset_input_tokens"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
@@ -99,6 +97,7 @@ const RandomSettingsForm: React.FC<{
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="request_rate"
|
||||
getValueProps={(value) => ({ value: value < 0 ? 'Infinity' : value })}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
@@ -107,7 +106,6 @@ const RandomSettingsForm: React.FC<{
|
||||
]}
|
||||
>
|
||||
<SealInputNumber
|
||||
min={0}
|
||||
disabled={disabled}
|
||||
label={intl.formatMessage({ id: 'benchmark.table.requestRate' })}
|
||||
required
|
||||
|
||||
Reference in New Issue
Block a user