Skip to content

refactor: replace the deprecated ModelFilter with dict-based filters for hugging_face compatibility - #32

Open
lokeshllkumar wants to merge 1 commit into
AI4Bharat:nemo-v2from
lokeshllkumar:fix/remove-modelfilter
Open

refactor: replace the deprecated ModelFilter with dict-based filters for hugging_face compatibility#32
lokeshllkumar wants to merge 1 commit into
AI4Bharat:nemo-v2from
lokeshllkumar:fix/remove-modelfilter

Conversation

@lokeshllkumar

Copy link
Copy Markdown

Description

The change removes the use of the now deprecated ModelFilter class from the huggingface_hub package in the nemo/core/classes/mixins/hf_io_mixin.py file. It replaces the construction of the model filter and its usage with a new dictionary-based approach compatible with huggingface_hub==0.33.1 (the latest version at the time of this commit). The changes made are listed as follows:

  • get_hf_model_filter() now returns a filter dict
  • search_huggingface_models() accepts a dict or a list of dicts
  • Support for metadata keys and filter parameters is preserved
  • Ensures that "nemo" is enforced into the library filter

What does this PR do ?

Fixes a critical dependency issue caused by usage of a now deprecated class ModelFilter from the huggingface_hub package, used in nemo/core/classes/mixins/hf_io_mixin.py.

Additional Information

…for latest huggingface_hub compatibility

The change removes the use of huggingface_hub's now deprecated ModelFilter class in the hf_io_mixin.py file. It replaces the construction of the model filter and its usage with a new dictionary-based approach compatible with huggingface_hub==0.33.1 (the latest version at the time of this commit).

- get_hf_model_filter() now returns a filter dict
- search_huggingface_models() accepts a dict or a list of dicts
- Support for metadata keys and filter parameters is preserved
- Ensures that 'nemo' is enforced into the library filter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant