fix: model editor system not being preserved

This commit is contained in:
Timothy Jaeryang Baek 2025-04-18 02:23:25 -07:00
parent a22be555cb
commit 8f67ffabbd

View File

@ -56,6 +56,7 @@
}
}
let system = '';
let info = {
id: '',
base_model_id: null,
@ -155,6 +156,7 @@
}
}
info.params.system = system.trim() === '' ? null : system;
info.params.stop = params.stop ? params.stop.split(',').filter((s) => s.trim()) : null;
Object.keys(info.params).forEach((key) => {
if (info.params[key] === '' || info.params[key] === null) {
@ -201,6 +203,8 @@
}
}
system = model?.params?.system ?? '';
params = { ...params, ...model?.params };
params.stop = params?.stop
? (typeof params.stop === 'string' ? params.stop.split(',') : (params?.stop ?? [])).join(
@ -553,7 +557,7 @@
className=" text-sm w-full bg-transparent outline-hidden resize-none overflow-y-hidden "
placeholder={`Write your model system prompt content here\ne.g.) You are Mario from Super Mario Bros, acting as an assistant.`}
rows={4}
bind:value={info.params.system}
bind:value={system}
/>
</div>
</div>