Skip to content

Commit

Permalink
Merge pull request #4634 from voxel51/bug/4587
Browse files Browse the repository at this point in the history
Fix bug when loading HF transformers from zoo
  • Loading branch information
brimoor authored Aug 8, 2024
2 parents 8b3b841 + 3aa68f3 commit 6e3f77c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fiftyone/utils/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def __init__(self, config):
self.config = config
self.model = self._load_model(config)
self.device = (
"cuda" if next(config.model.parameters()).is_cuda else "cpu"
"cuda" if next(self.model.parameters()).is_cuda else "cpu"
)
self.image_processor = self._load_image_processor()

Expand Down Expand Up @@ -499,7 +499,7 @@ def __init__(self, config):
self.classes = config.classes
self.model = self._load_model(config)
self.device = (
"cuda" if next(config.model.parameters()).is_cuda else "cpu"
"cuda" if next(self.model.parameters()).is_cuda else "cpu"
)
self.processor = self._load_processor()
self._text_prompts = None
Expand Down Expand Up @@ -748,10 +748,10 @@ def __init__(self, config):
self.config = config
self.classes = config.classes
self.processor = self._load_processor(config)
self.model = self._load_model(config)
self.device = (
"cuda" if next(config.model.parameters()).is_cuda else "cpu"
"cuda" if next(self.model.parameters()).is_cuda else "cpu"
)
self.model = self._load_model(config)
self._text_prompts = None

def _load_processor(self, config):
Expand Down

0 comments on commit 6e3f77c

Please sign in to comment.