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:
n4ze3m
2024-11-09 16:56:47 +05:30
parent 7c805cfe22
commit fd654cafdb
20 changed files with 119 additions and 17 deletions

View File

@@ -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"

View File

@@ -77,7 +77,14 @@ export const ModelSettings = () => {
size="large"
/>
</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"