Skip to content

Commit 14ac4ab

Browse files
committed
Change huggingface hub revision delimiter to '@', add hf_hub reference for eca_nfnet_l0 model as an example.
1 parent 740f32c commit 14ac4ab

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

timm/models/hub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ def has_hf_hub(necessary=False):
6161

6262

6363
def hf_split(hf_id):
64-
rev_split = hf_id.split('#')
65-
assert 0 < len(rev_split) <= 2, 'hf_hub id should only contain one # character to identify revision.'
64+
rev_split = hf_id.split('@')
65+
assert 0 < len(rev_split) <= 2, 'hf_hub id should only contain one @ character to identify revision.'
6666
hf_model_id = rev_split[0]
6767
hf_revision = rev_split[-1] if len(rev_split) > 1 else None
6868
return hf_model_id, hf_revision

timm/models/nfnet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def _dcfg(url='', **kwargs):
106106
url='', pool_size=(7, 7), input_size=(3, 224, 224), test_input_size=(3, 288, 288)),
107107
eca_nfnet_l0=_dcfg(
108108
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/ecanfnet_l0_ra2-e3e9ac50.pth',
109+
hf_hub='timm/eca_nfnet_l0',
109110
pool_size=(7, 7), input_size=(3, 224, 224), test_input_size=(3, 288, 288), crop_pct=1.0),
110111

111112
nf_regnet_b0=_dcfg(

0 commit comments

Comments
 (0)