KeyError: 'modernbert'

#1
by do-me - opened

Hi, thanks for the great collection.
The base model runs perfectly on Python 3.12 on MacOS but I get this error for small and edge models. Do you know why?
Thanks!

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[3], line 6
      3 from gliner import GLiNER
      5 # Load the model (downloads automatically on first use)
----> 6 model = GLiNER.from_pretrained("knowledgator/gliner-pii-small-v1.0")

File /opt/homebrew/Caskroom/miniconda/base/envs/py3.12/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py:114, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs)
    111 if check_use_auth_token:
    112     kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs)
--> 114 return fn(*args, **kwargs)

File /opt/homebrew/Caskroom/miniconda/base/envs/py3.12/lib/python3.12/site-packages/huggingface_hub/hub_mixin.py:550, in ModelHubMixin.from_pretrained(cls, pretrained_model_name_or_path, force_download, resume_download, proxies, token, cache_dir, local_files_only, revision, **model_kwargs)
    547     if cls._hub_mixin_inject_config and "config" not in model_kwargs:
    548         model_kwargs["config"] = config
--> 550 instance = cls._from_pretrained(
    551     model_id=str(model_id),
    552     revision=revision,
    553     cache_dir=cache_dir,
    554     force_download=force_download,
    555     proxies=proxies,
    556     resume_download=resume_download,
    557     local_files_only=local_files_only,
    558     token=token,
    559     **model_kwargs,
...
--> 740     raise KeyError(key)
    741 value = self._mapping[key]
    742 module_name = model_type_to_module_name(key)

KeyError: 'modernbert'

Resolved with a fresh py3.13 env; works now. Maybe you could add this info to the model card.

Sign up or log in to comment