From a383ef99f532a855c4c467cdf981b91e28238c85 Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Fri, 23 Sep 2022 13:54:21 -0700 Subject: [PATCH] Make huggingface_hub necessary if it's the only source for a pretrained weight --- timm/models/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/models/helpers.py b/timm/models/helpers.py index b84a4523..d68c7e65 100644 --- a/timm/models/helpers.py +++ b/timm/models/helpers.py @@ -134,7 +134,7 @@ def _resolve_pretrained_source(pretrained_cfg): elif pretrained_url: load_from = 'url' pretrained_loc = pretrained_url - elif hf_hub_id and has_hf_hub(necessary=False): + elif hf_hub_id and has_hf_hub(necessary=True): # hf-hub available as alternate weight source in default_cfg load_from = 'hf-hub' pretrained_loc = hf_hub_id