Browse Source

Minor fix to BLIP offloading

pull/52/head v0.5.3
pharmapsychotic 2 years ago
parent
commit
384e234ba2
  1. 2
      README.md
  2. 2
      clip_interrogator/clip_interrogator.py
  3. 2
      setup.py

2
README.md

@ -36,7 +36,7 @@ Install with PIP
pip3 install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu117 pip3 install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu117
# install clip-interrogator # install clip-interrogator
pip install clip-interrogator==0.5.2 pip install clip-interrogator==0.5.3
``` ```
You can then use it in your script You can then use it in your script

2
clip_interrogator/clip_interrogator.py

@ -300,7 +300,7 @@ class Interrogator():
self.blip_offloaded = False self.blip_offloaded = False
def _prepare_clip(self): def _prepare_clip(self):
if self.config.blip_offload: if self.config.blip_offload and not self.blip_offloaded:
self.blip_model = self.blip_model.to('cpu') self.blip_model = self.blip_model.to('cpu')
self.blip_offloaded = True self.blip_offloaded = True
if self.clip_offloaded: if self.clip_offloaded:

2
setup.py

@ -5,7 +5,7 @@ from setuptools import setup, find_packages
setup( setup(
name="clip-interrogator", name="clip-interrogator",
version="0.5.2", version="0.5.3",
license='MIT', license='MIT',
author='pharmapsychotic', author='pharmapsychotic',
author_email='me@pharmapsychotic.com', author_email='me@pharmapsychotic.com',

Loading…
Cancel
Save