Added blank prompt preservation

This commit is contained in:
Jaret Burkett
2025-10-22 14:55:13 -06:00
parent ca57ffc270
commit ee206cfa18
7 changed files with 143 additions and 28 deletions

View File

@@ -215,12 +215,12 @@ export default function SimpleJob({
</FormGroup>
)}
{modelArch?.additionalSections?.includes('model.qie.match_target_res') && (
<Checkbox
label="Match Target Res"
docKey="model.qie.match_target_res"
checked={jobConfig.config.process[0].model.model_kwargs.match_target_res}
onChange={value => setJobConfig(value, 'config.process[0].model.model_kwargs.match_target_res')}
/>
<Checkbox
label="Match Target Res"
docKey="model.qie.match_target_res"
checked={jobConfig.config.process[0].model.model_kwargs.match_target_res}
onChange={value => setJobConfig(value, 'config.process[0].model.model_kwargs.match_target_res')}
/>
)}
{modelArch?.additionalSections?.includes('model.layer_offloading') && (
<>
@@ -586,16 +586,27 @@ export default function SimpleJob({
</FormGroup>
</div>
<div>
{disableSections.includes('train.diff_output_preservation') ||
disableSections.includes('train.blank_prompt_preservation') ? null : (
<FormGroup label="Regularization">
<></>
</FormGroup>
)}
{disableSections.includes('train.diff_output_preservation') ? null : (
<>
<FormGroup label="Regularization">
<Checkbox
label="Differential Output Preservation"
className="pt-1"
checked={jobConfig.config.process[0].train.diff_output_preservation || false}
onChange={value => setJobConfig(value, 'config.process[0].train.diff_output_preservation')}
/>
</FormGroup>
<Checkbox
label="Differential Output Preservation"
docKey={'train.diff_output_preservation'}
className="pt-1"
checked={jobConfig.config.process[0].train.diff_output_preservation || false}
onChange={value => {
setJobConfig(value, 'config.process[0].train.diff_output_preservation');
if (value && jobConfig.config.process[0].train.blank_prompt_preservation) {
// only one can be enabled at a time
setJobConfig(false, 'config.process[0].train.blank_prompt_preservation');
}
}}
/>
{jobConfig.config.process[0].train.diff_output_preservation && (
<>
<NumberInput
@@ -610,7 +621,7 @@ export default function SimpleJob({
/>
<TextInput
label="DOP Preservation Class"
className="pt-2"
className="pt-2 pb-4"
value={jobConfig.config.process[0].train.diff_output_preservation_class as string}
onChange={value =>
setJobConfig(value, 'config.process[0].train.diff_output_preservation_class')
@@ -621,6 +632,39 @@ export default function SimpleJob({
)}
</>
)}
{disableSections.includes('train.blank_prompt_preservation') ? null : (
<>
<Checkbox
label="Blank Prompt Preservation"
docKey={'train.blank_prompt_preservation'}
className="pt-1"
checked={jobConfig.config.process[0].train.blank_prompt_preservation || false}
onChange={value => {
setJobConfig(value, 'config.process[0].train.blank_prompt_preservation');
if (value && jobConfig.config.process[0].train.diff_output_preservation) {
// only one can be enabled at a time
setJobConfig(false, 'config.process[0].train.diff_output_preservation');
}
}}
/>
{jobConfig.config.process[0].train.blank_prompt_preservation && (
<>
<NumberInput
label="BPP Loss Multiplier"
className="pt-2"
value={
(jobConfig.config.process[0].train.blank_prompt_preservation_multiplier as number) || 1.0
}
onChange={value =>
setJobConfig(value, 'config.process[0].train.blank_prompt_preservation_multiplier')
}
placeholder="eg. 1.0"
min={0}
/>
</>
)}
</>
)}
</div>
</div>
</Card>

View File

@@ -9,6 +9,7 @@ type DisableableSections =
| 'network.conv'
| 'trigger_word'
| 'train.diff_output_preservation'
| 'train.blank_prompt_preservation'
| 'train.unload_text_encoder'
| 'slider';