From 5482d2e501500c27afafd15a4799732c6e2eb24d Mon Sep 17 00:00:00 2001 From: Sylvain Gugger Date: Thu, 11 Feb 2021 11:11:26 -0500 Subject: [PATCH] Actually load the model --- timm/models/factory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/timm/models/factory.py b/timm/models/factory.py index fd3ce804..fa23150c 100644 --- a/timm/models/factory.py +++ b/timm/models/factory.py @@ -55,10 +55,10 @@ def create_model( try: model_cfg = load_hf_checkpoint_config(model_name, revision=kwargs.get("hf_revision")) create_fn = model_entrypoint(model_cfg.pop("architecture")) - model = create_fn(**model_args, **kwargs) + model = create_fn(**model_args, hf_checkpoint=model_name, **kwargs) # Probably need some extra stuff, but this is a PoC of how the config in the model hub # could overwrite the default config values. - model.default_cfg.update(model_cfg) + # model.default_cfg.update(model_cfg) except Exception as e: raise RuntimeError('Unknown model or checkpoint from the Hugging Face hub (%s)' % model_name)