From ead80d33c59ca18acaaa594159ca28b6116e9acb Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Tue, 16 Mar 2021 23:02:51 -0700 Subject: [PATCH] Fix typo, naming consistency --- timm/models/helpers.py | 2 +- timm/models/hub.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/timm/models/helpers.py b/timm/models/helpers.py index 61764857..8e2809f3 100644 --- a/timm/models/helpers.py +++ b/timm/models/helpers.py @@ -170,7 +170,7 @@ def load_pretrained(model, default_cfg=None, num_classes=1000, in_chans=3, filte _logger.warning("No pretrained weights exist for this model. Using random initialization.") return if hf_hub_id and has_hf_hub(necessary=not pretrained_url): - _logger.info(f'Loading pretrained weights from huggingface hub ({hf_hub_id})') + _logger.info(f'Loading pretrained weights from Hugging Face hub ({hf_hub_id})') state_dict = load_state_dict_from_hf(hf_hub_id) else: _logger.info(f'Loading pretrained weights from url ({pretrained_url})') diff --git a/timm/models/hub.py b/timm/models/hub.py index 58738167..e255e39b 100644 --- a/timm/models/hub.py +++ b/timm/models/hub.py @@ -56,13 +56,13 @@ def has_hf_hub(necessary=False): if hf_hub_url is None and necessary: # if no HF Hub module installed and it is necessary to continue, raise error raise RuntimeError( - 'HuggignFace Hub model specified but package not installed. Run `pip install huggingface_hub`.') + 'Hugging Face hub model specified but package not installed. Run `pip install huggingface_hub`.') return hf_hub_url is not None def hf_split(hf_id): rev_split = hf_id.split('#') - assert 0 < len(rev_split) <= 2, 'HuggingFace HUB identifier should only contain on # character to identify revision.' + assert 0 < len(rev_split) <= 2, 'hf_hub id should only contain one # character to identify revision.' hf_model_id = rev_split[0] hf_revision = rev_split[-1] if len(rev_split) > 1 else None return hf_model_id, hf_revision