diff --git a/libs/spandrel/spandrel/__helpers/model_descriptor.py b/libs/spandrel/spandrel/__helpers/model_descriptor.py index f682a7de..c7491e19 100644 --- a/libs/spandrel/spandrel/__helpers/model_descriptor.py +++ b/libs/spandrel/spandrel/__helpers/model_descriptor.py @@ -465,7 +465,8 @@ def __call__(self, image: Tensor) -> Tensor: did_pad, image = pad_tensor(image, self.size_requirements) # Optimize for inference - self.model.eval() + if self.model.training: + self.model.eval() # call model output = self._call_fn(self.model, image)