Add training adapter for MiniMax H3 ref2va and default to contrastive loss with adapter
This commit is contained in:
@@ -892,6 +892,10 @@ export const modelArchs: ModelArch[] = [
|
|||||||
'config.process[0].train.cache_text_embeddings': [true, false],
|
'config.process[0].train.cache_text_embeddings': [true, false],
|
||||||
'config.process[0].train.do_guidance_loss': [true, undefined],
|
'config.process[0].train.do_guidance_loss': [true, undefined],
|
||||||
'config.process[0].train.guidance_loss_target': [3.5, undefined],
|
'config.process[0].train.guidance_loss_target': [3.5, undefined],
|
||||||
|
'config.process[0].model.assistant_lora_path': [
|
||||||
|
'ostris/minimax_h3_training_adapter/minimax_h3_ref2va_training_adapter_v1.safetensors',
|
||||||
|
undefined,
|
||||||
|
],
|
||||||
'config.process[0].network.linear': [16, defaultLinearRank],
|
'config.process[0].network.linear': [16, defaultLinearRank],
|
||||||
'config.process[0].network.linear_alpha': [16, defaultLinearRank],
|
'config.process[0].network.linear_alpha': [16, defaultLinearRank],
|
||||||
'config.process[0].network.network_kwargs.ignore_if_contains': [['adaln_proj'], []],
|
'config.process[0].network.network_kwargs.ignore_if_contains': [['adaln_proj'], []],
|
||||||
@@ -921,6 +925,66 @@ export const modelArchs: ModelArch[] = [
|
|||||||
'datasets.audio_preserve_pitch',
|
'datasets.audio_preserve_pitch',
|
||||||
'train.audio_loss_multiplier',
|
'train.audio_loss_multiplier',
|
||||||
'datasets.auto_frame_count',
|
'datasets.auto_frame_count',
|
||||||
|
'model.assistant_lora_path',
|
||||||
|
],
|
||||||
|
customModelSelectOptions: [
|
||||||
|
{
|
||||||
|
label: 'Distillation Handling Method',
|
||||||
|
options: [
|
||||||
|
{ value: 'cg', label: 'Contrastive Guidance' },
|
||||||
|
{ value: 'ta', label: 'Training Adapter' },
|
||||||
|
{ value: 'both', label: 'Contrastive Guidance + Training Adapter (default)' },
|
||||||
|
],
|
||||||
|
getValue: (config: JobConfig) => {
|
||||||
|
const assistantLoraPath = config?.config?.process?.[0]?.model?.assistant_lora_path;
|
||||||
|
const hasAssistantLoraPath = assistantLoraPath && assistantLoraPath.trim() !== '';
|
||||||
|
const hasContrastiveGuidance = config?.config?.process?.[0]?.train?.do_guidance_loss;
|
||||||
|
if (hasAssistantLoraPath && hasContrastiveGuidance) {
|
||||||
|
return 'both';
|
||||||
|
}
|
||||||
|
if (hasAssistantLoraPath) {
|
||||||
|
return 'ta';
|
||||||
|
}
|
||||||
|
return 'cg';
|
||||||
|
},
|
||||||
|
onChange: (value: string, config: JobConfig, setJobConfig: (value: any, key: string) => void) => {
|
||||||
|
if (value === 'cg') {
|
||||||
|
setJobConfig(true, 'config.process[0].train.do_guidance_loss');
|
||||||
|
setJobConfig(undefined, 'config.process[0].model.assistant_lora_path');
|
||||||
|
if (!config?.config?.process?.[0]?.train?.guidance_loss_target) {
|
||||||
|
setJobConfig(3.5, 'config.process[0].train.guidance_loss_target');
|
||||||
|
}
|
||||||
|
} else if (value === 'ta') {
|
||||||
|
setJobConfig(undefined, 'config.process[0].train.do_guidance_loss');
|
||||||
|
setJobConfig(undefined, 'config.process[0].train.guidance_loss_target');
|
||||||
|
setJobConfig(
|
||||||
|
'ostris/minimax_h3_training_adapter/minimax_h3_ref2va_training_adapter_v1.safetensors',
|
||||||
|
'config.process[0].model.assistant_lora_path',
|
||||||
|
);
|
||||||
|
} else if (value === 'both') {
|
||||||
|
setJobConfig(true, 'config.process[0].train.do_guidance_loss');
|
||||||
|
setJobConfig(
|
||||||
|
'ostris/minimax_h3_training_adapter/minimax_h3_ref2va_training_adapter_v1.safetensors',
|
||||||
|
'config.process[0].model.assistant_lora_path',
|
||||||
|
);
|
||||||
|
if (!config?.config?.process?.[0]?.train?.guidance_loss_target) {
|
||||||
|
setJobConfig(3.5, 'config.process[0].train.guidance_loss_target');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doc: {
|
||||||
|
title: 'MiniMax-H3 Distillation Handling',
|
||||||
|
description: (
|
||||||
|
<div>
|
||||||
|
MiniMax H3 is a guidance distilled model, so training on it directly will make the guidance distillation
|
||||||
|
break down. There are two different ways to train on this model without breaking the guidance
|
||||||
|
distillation: Contrastive Guidance and Training Adapter. Both have their pros and cons. The adapter is
|
||||||
|
faster, but will still break down over a long run. Contrastive Guidance is slower, but is less likely to
|
||||||
|
break down.
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
modelNotes: (
|
modelNotes: (
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
VERSION = "0.12.23"
|
VERSION = "0.12.24"
|
||||||
|
|||||||
Reference in New Issue
Block a user