feat: Add max tokens setting for model generations
Adds a new setting to control the maximum number of tokens generated by the model. This provides more control over the length of responses and can be useful for limiting the amount of text generated in certain situations.
This commit is contained in:
@@ -39,12 +39,14 @@ export const CurrentChatModelSettings = ({
|
||||
numCtx: cUserSettings.numCtx ?? data.numCtx,
|
||||
seed: cUserSettings.seed,
|
||||
numGpu: cUserSettings.numGpu ?? data.numGpu,
|
||||
numPredict: cUserSettings.numPredict ?? data.numPredict,
|
||||
systemPrompt: cUserSettings.systemPrompt ?? ""
|
||||
})
|
||||
return data
|
||||
},
|
||||
enabled: open,
|
||||
refetchOnMount: true
|
||||
refetchOnMount: false,
|
||||
refetchOnWindowFocus: false
|
||||
})
|
||||
|
||||
const renderBody = () => {
|
||||
@@ -115,6 +117,15 @@ export const CurrentChatModelSettings = ({
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="numPredict"
|
||||
label={t("modelSettings.form.numPredict.label")}>
|
||||
<InputNumber
|
||||
style={{ width: "100%" }}
|
||||
placeholder={t("modelSettings.form.numPredict.placeholder")}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Collapse
|
||||
ghost
|
||||
className="border-none bg-transparent"
|
||||
|
||||
Reference in New Issue
Block a user