Don't ruin breakmodel

This commit is contained in:
Henk
2023-07-15 14:14:06 +02:00
parent 003105ae8b
commit 2c50d5d092

View File

@@ -412,7 +412,7 @@ class HFTorchInferenceModel(HFInferenceModel):
**tf_kwargs, **tf_kwargs,
) )
if not self.lazy_load: if not self.lazy_load and not self.breakmodel:
# We need to move the model to the desired device # We need to move the model to the desired device
if (not self.usegpu) or torch.cuda.device_count() <= 0: if (not self.usegpu) or torch.cuda.device_count() <= 0:
model = model.to("cpu") model = model.to("cpu")