Change huggingface hub revision delimiter to '@', add hf_hub reference for eca_nfnet_l0 model as an example.

pull/510/head
Ross Wightman 3 years ago
parent 740f32c96a
commit 14ac4abf74

@ -61,8 +61,8 @@ def has_hf_hub(necessary=False):
def hf_split(hf_id):
rev_split = hf_id.split('#')
assert 0 < len(rev_split) <= 2, 'hf_hub id should only contain one # character to identify revision.'
rev_split = hf_id.split('@')
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

@ -106,6 +106,7 @@ default_cfgs = dict(
url='', pool_size=(7, 7), input_size=(3, 224, 224), test_input_size=(3, 288, 288)),
eca_nfnet_l0=_dcfg(
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/ecanfnet_l0_ra2-e3e9ac50.pth',
hf_hub='timm/eca_nfnet_l0',
pool_size=(7, 7), input_size=(3, 224, 224), test_input_size=(3, 288, 288), crop_pct=1.0),
nf_regnet_b0=_dcfg(

Loading…
Cancel
Save