Skip to content

Commit

Permalink
fix: janhq#1559 Inference Parameters displayed on new thread with Ope…
Browse files Browse the repository at this point in the history
…nai GPT model (janhq#1588)
  • Loading branch information
louis-jan authored Jan 15, 2024
1 parent 901f49f commit 0ffb756
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions web/containers/DropdownListSidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,16 @@ export default function DropdownListSidebar() {
const modelParams: ModelParams = {
...recommendedModel?.parameters,
...recommendedModel?.settings,
// This is to set default value for these settings instead of maximum value
max_tokens: defaultValue(recommendedModel?.parameters.max_tokens),
ctx_len: defaultValue(recommendedModel?.settings.ctx_len),
/**
* This is to set default value for these settings instead of maximum value
* Should only apply when model.json has these settings
*/
...(recommendedModel?.parameters.max_tokens && {
max_tokens: defaultValue(recommendedModel?.parameters.max_tokens),
}),
...(recommendedModel?.settings.ctx_len && {
ctx_len: defaultValue(recommendedModel?.settings.ctx_len),
}),
}
setThreadModelParams(activeThread.id, modelParams)
}
Expand Down

0 comments on commit 0ffb756

Please sign in to comment.