We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c2e10a commit afafb24Copy full SHA for afafb24
src/diffusers/pipelines/transformers_loading_utils.py
@@ -112,10 +112,14 @@ def _load_transformers_model_from_dduf(
112
tensors = safetensors.torch.load(mmap)
113
# Update the state dictionary with tensors
114
state_dict.update(tensors)
115
- return cls.from_pretrained(
+ model = cls.from_pretrained(
116
pretrained_model_name_or_path=None,
117
config=config,
118
generation_config=generation_config,
119
state_dict=state_dict,
120
**kwargs,
121
)
122
+ # Models loaded via from_pretrained are in eval mode by default,
123
+ # but we need to preserve training mode for consistency with non-DDUF loading
124
+ model.train()
125
+ return model
0 commit comments