forked from XiaoMo/ChatGPT-Next-Web
fixup: request params
This commit is contained in:
parent
b23adf9d5d
commit
e654cee3c8
@ -241,7 +241,10 @@ export function SessionConfigModel(props: { onClose: () => void }) {
|
||||
open={showPicker}
|
||||
onClose={() => setShowPicker(false)}
|
||||
>
|
||||
<div onClick={() => setShowPicker(true)}>
|
||||
<div
|
||||
onClick={() => setShowPicker(true)}
|
||||
style={{ cursor: "pointer" }}
|
||||
>
|
||||
{session.avatar ? (
|
||||
<Avatar avatar={session.avatar} />
|
||||
) : (
|
||||
|
@ -37,7 +37,7 @@ export function ModelConfigList(props: {
|
||||
<InputRange
|
||||
value={props.modelConfig.temperature?.toFixed(1)}
|
||||
min="0"
|
||||
max="2"
|
||||
max="1" // lets limit it to 0-1
|
||||
step="0.1"
|
||||
onChange={(e) => {
|
||||
props.updateConfig(
|
||||
|
@ -28,11 +28,10 @@ const makeRequestParam = (
|
||||
sendMessages = sendMessages.filter((m) => m.role !== "assistant");
|
||||
}
|
||||
|
||||
const modelConfig = { ...useAppConfig.getState().modelConfig };
|
||||
|
||||
// @yidadaa: wont send max_tokens, because it is nonsense for Muggles
|
||||
// @ts-expect-error
|
||||
delete modelConfig.max_tokens;
|
||||
const modelConfig = {
|
||||
...useAppConfig.getState().modelConfig,
|
||||
...useChatStore.getState().currentSession().modelConfig,
|
||||
};
|
||||
|
||||
// override model config
|
||||
if (options?.model) {
|
||||
@ -42,7 +41,9 @@ const makeRequestParam = (
|
||||
return {
|
||||
messages: sendMessages,
|
||||
stream: options?.stream,
|
||||
...modelConfig,
|
||||
model: modelConfig.model,
|
||||
temperature: modelConfig.temperature,
|
||||
presence_penalty: modelConfig.presence_penalty,
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -108,7 +108,7 @@ export const ModalConfigValidator = {
|
||||
return limitNumber(x, -2, 2, 0);
|
||||
},
|
||||
temperature(x: number) {
|
||||
return limitNumber(x, 0, 2, 1);
|
||||
return limitNumber(x, 0, 1, 1);
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user