diff --git a/fairseq/dataclass/configs.py b/fairseq/dataclass/configs.py index 3f3ea69..12c0dba 100644 --- a/fairseq/dataclass/configs.py +++ b/fairseq/dataclass/configs.py @@ -1126,16 +1126,18 @@ class EMAConfig(FairseqDataclass): @dataclass class FairseqConfig(FairseqDataclass): - common: CommonConfig = CommonConfig() - common_eval: CommonEvalConfig = CommonEvalConfig() - distributed_training: DistributedTrainingConfig = DistributedTrainingConfig() - dataset: DatasetConfig = DatasetConfig() - optimization: OptimizationConfig = OptimizationConfig() - checkpoint: CheckpointConfig = CheckpointConfig() - bmuf: FairseqBMUFConfig = FairseqBMUFConfig() - generation: GenerationConfig = GenerationConfig() - eval_lm: EvalLMConfig = EvalLMConfig() - interactive: InteractiveConfig = InteractiveConfig() + common: CommonConfig = field(default_factory=CommonConfig) + common_eval: CommonEvalConfig = field(default_factory=CommonEvalConfig) + distributed_training: DistributedTrainingConfig = field( + default_factory=DistributedTrainingConfig, + ) + dataset: DatasetConfig = field(default_factory=DatasetConfig) + optimization: OptimizationConfig = field(default_factory=OptimizationConfig) + checkpoint: CheckpointConfig = field(default_factory=CheckpointConfig) + bmuf: FairseqBMUFConfig = field(default_factory=FairseqBMUFConfig) + generation: GenerationConfig = field(default_factory=GenerationConfig) + eval_lm: EvalLMConfig = field(default_factory=EvalLMConfig) + interactive: InteractiveConfig = field(default_factory=InteractiveConfig) model: Any = MISSING task: Any = None criterion: Any = None @@ -1144,4 +1146,4 @@ class FairseqConfig(FairseqDataclass): scoring: Any = None bpe: Any = None tokenizer: Any = None - ema: EMAConfig = EMAConfig() + ema: EMAConfig = field(default_factory=EMAConfig)