fix: prevent inference tensor version counter tracking issue for GroundingDINO

use no_grad and inference_mode on predict_with_caption
see https://github.com/lllyasviel/Fooocus/discussions/3213#discussioncomment-10017126
This commit is contained in:
Manuel Schmid 2024-07-13 15:49:07 +02:00
parent 89cb354e8b
commit efb6ca01d3
No known key found for this signature in database
GPG Key ID: 32C4F7569B40B84B
1 changed files with 2 additions and 0 deletions

View File

@ -19,6 +19,8 @@ class GroundingDinoModel(Model):
self.load_device = torch.device('cpu')
self.offload_device = torch.device('cpu')
@torch.no_grad()
@torch.inference_mode()
def predict_with_caption(
self,
image: np.ndarray,