From bf7404d7faf7a7a8ebd403b07b319c34b0a652d6 Mon Sep 17 00:00:00 2001 From: pharmapsychotic Date: Sat, 18 Feb 2023 22:29:36 -0600 Subject: [PATCH] When blip_offload enabled keep BLIP model on CPU to start. --- clip_interrogator/clip_interrogator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clip_interrogator/clip_interrogator.py b/clip_interrogator/clip_interrogator.py index 8da0472..8a92b6e 100644 --- a/clip_interrogator/clip_interrogator.py +++ b/clip_interrogator/clip_interrogator.py @@ -89,7 +89,8 @@ class Interrogator(): med_config=med_config ) blip_model.eval() - blip_model = blip_model.to(config.device) + if not self.config.blip_offload: + blip_model = blip_model.to(config.device) self.blip_model = blip_model else: self.blip_model = config.blip_model