Skip to content

Commit

Permalink
Merge pull request #347 from understandable-machine-intelligence-lab/…
Browse files Browse the repository at this point in the history
…bugfix-if-pretrained

small bugfix pytorch_model.py
  • Loading branch information
annahedstroem authored Mar 24, 2024
2 parents ec037dc + 7147307 commit e381373
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quantus/helpers/model/pytorch_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _get_model_with_linear_top(self) -> torch.nn:

def _obtain_predictions(self, x, model_predict_kwargs):
pred = None
if isinstance(self.model, PreTrainedModel):
if PreTrainedModel is not None and isinstance(self.model, PreTrainedModel):
# BatchEncoding is the default output from Tokenizers which contains
# necessary keys such as `input_ids` and `attention_mask`.
# It is also possible to pass a Dict with those keys.
Expand Down

0 comments on commit e381373

Please sign in to comment.