ultralytics 8.1.32 fix CLIP backwards compatibility (#9253)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
7d2e94bbe2
commit
6de99a29e6
4 changed files with 10 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
__version__ = "8.1.31"
|
||||
__version__ = "8.1.32"
|
||||
|
||||
from ultralytics.data.explorer.explorer import Explorer
|
||||
from ultralytics.models import RTDETR, SAM, YOLO, YOLOWorld
|
||||
|
|
|
|||
|
|
@ -572,7 +572,7 @@ class WorldModel(DetectionModel):
|
|||
check_requirements("git+https://github.com/openai/CLIP.git")
|
||||
import clip
|
||||
|
||||
if not self.clip_model:
|
||||
if not getattr(self, "clip_model", None): # for backwards compatibility of models lacking clip_model attribute
|
||||
self.clip_model = clip.load("ViT-B/32")[0]
|
||||
device = next(self.clip_model.parameters()).device
|
||||
text_token = clip.tokenize(text).to(device)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue