fix: chat compare switch model meta
This commit is contained in:
@@ -14,6 +14,7 @@ interface ActiveModelsProps {
|
||||
|
||||
const ActiveModels: React.FC<ActiveModelsProps> = (props) => {
|
||||
const { spans, modelSelections, setModelRefs } = props;
|
||||
|
||||
return (
|
||||
<Row gutter={[16, 0]} style={{ height: '100%' }}>
|
||||
{modelSelections.map((model, index) => (
|
||||
@@ -21,7 +22,8 @@ const ActiveModels: React.FC<ActiveModelsProps> = (props) => {
|
||||
span={spans.span}
|
||||
key={`${model.value || 'empty'}-${model.uid}`}
|
||||
style={{
|
||||
height: spans.count < 4 ? 'calc(100% - 16px)' : 'calc(50% - 16px)'
|
||||
height: spans.count < 4 ? 'calc(100% - 16px)' : 'calc(50% - 16px)',
|
||||
overflow: 'hidden'
|
||||
}}
|
||||
>
|
||||
<ModelItem
|
||||
|
||||
@@ -47,7 +47,8 @@ interface ModelItemProps {
|
||||
}
|
||||
|
||||
const ModelItem: React.FC<ModelItemProps> = forwardRef((props, ref) => {
|
||||
const { modelList, model, instanceId } = props;
|
||||
const { modelList, ...restProps } = props;
|
||||
const { model, instanceId } = restProps;
|
||||
const {
|
||||
globalParams,
|
||||
setGlobalParams,
|
||||
@@ -66,14 +67,20 @@ const ModelItem: React.FC<ModelItemProps> = forwardRef((props, ref) => {
|
||||
paramsConfig,
|
||||
initialValues,
|
||||
parameters
|
||||
} = useInitLLmMeta(props, {
|
||||
defaultValues: {
|
||||
...llmInitialValues,
|
||||
model: model
|
||||
} = useInitLLmMeta(
|
||||
{
|
||||
...restProps,
|
||||
modelList: modelFullList
|
||||
},
|
||||
defaultParamsConfig: ChatParamsConfig,
|
||||
metaKeys: LLM_METAKEYS
|
||||
});
|
||||
{
|
||||
defaultValues: {
|
||||
...llmInitialValues,
|
||||
model: model
|
||||
},
|
||||
defaultParamsConfig: ChatParamsConfig,
|
||||
metaKeys: LLM_METAKEYS
|
||||
}
|
||||
);
|
||||
const intl = useIntl();
|
||||
const isApplyToAllModels = useRef(false);
|
||||
const [systemMessage, setSystemMessage] = useState<string>('');
|
||||
|
||||
Reference in New Issue
Block a user