model inference settings
This commit is contained in:
@@ -52,6 +52,27 @@ router.patch('/', (req, res) => {
|
||||
updates.temperature = val;
|
||||
}
|
||||
|
||||
if (req.body.repeatPenalty !== undefined) {
|
||||
const val = Number(req.body.repeatPenalty);
|
||||
if (isNaN(val) || val < 1 || val > 2)
|
||||
return res.status(400).json({ error: 'repeatPenalty must be 1–2' });
|
||||
updates.repeatPenalty = val;
|
||||
}
|
||||
|
||||
if (req.body.topP !== undefined) {
|
||||
const val = Number(req.body.topP);
|
||||
if (isNaN(val) || val < 0 || val > 1)
|
||||
return res.status(400).json({ error: 'topP must be 0–1' });
|
||||
updates.topP = val;
|
||||
}
|
||||
|
||||
if (req.body.topK !== undefined) {
|
||||
const val = Number(req.body.topK);
|
||||
if (!Number.isInteger(val) || val < 1 || val > 100)
|
||||
return res.status(400).json({ error: 'topK must be 1–100' });
|
||||
updates.topK = val;
|
||||
}
|
||||
|
||||
res.json(settings.save(updates));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user