Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with NeMo Model Installation on Python 3.10.12: ImportError from huggingface_hub #11

Closed
shripadalkar opened this issue Dec 26, 2024 · 3 comments · Fixed by #12
Closed
Labels
bug Something isn't working

Comments

@shripadalkar
Copy link

I encountered an issue when trying to install and import the NeMo ASR model on Python 3.10.12. After following the installation steps, I received the following error during the import of the nemo.collections.asr module:
Steps to Reproduce:

steps 1
git clone https://github.com/AI4Bharat/NeMo.git && cd NeMo && git checkout nemo-v2 && bash reinstall.sh
step 2
import nemo.collections.asr as nemo_asr

Error:

Traceback (most recent call last):
File "", line 1, in
File "/home/shrikant/Project/python/ASR/speech_to_text_setup/dec262024/NeMo/nemo/collections/asr/init.py", line 15, in
from nemo.collections.asr import data, losses, models, modules
File "/home/shrikant/Project/python/ASR/speech_to_text_setup/dec262024/NeMo/nemo/collections/asr/losses/init.py", line 15, in
from nemo.collections.asr.losses.angularloss import AngularSoftmaxLoss
File "/home/shrikant/Project/python/ASR/speech_to_text_setup/dec262024/NeMo/nemo/collections/asr/losses/angularloss.py", line 18, in
from nemo.core.classes import Loss, Typing, typecheck
File "/home/shrikant/Project/python/ASR/speech_to_text_setup/dec262024/NeMo/nemo/core/init.py", line 16, in
from nemo.core.classes import *
File "/home/shrikant/Project/python/ASR/speech_to_text_setup/dec262024/NeMo/nemo/core/classes/init.py", line 20, in
from nemo.core.classes.common import (
File "/home/shrikant/Project/python/ASR/speech_to_text_setup/dec262024/NeMo/nemo/core/classes/common.py", line 40, in
from nemo.core.classes.mixins.hf_io_mixin import HuggingFaceFileIO
File "/home/shrikant/Project/python/ASR/speech_to_text_setup/dec262024/NeMo/nemo/core/classes/mixins/init.py", line 28, in
from nemo.core.classes.mixins.hf_io_mixin import HuggingFaceFileIO
File "/home/shrikant/Project/python/ASR/speech_to_text_setup/dec262024/NeMo/nemo/core/classes/mixins/hf_io_mixin.py", line 19, in
from huggingface_hub import HfApi, ModelCard, ModelCardData, ModelFilter
ImportError: cannot import name 'ModelFilter' from 'huggingface_hub' (/home/shrikant/Project/python/ASR/speech_to_text_setup/dec262024/asr/lib/python3.10/site-packages/huggingface_hub/init.py)

@shripadalkar shripadalkar added the bug Something isn't working label Dec 26, 2024
@wannasleepforlong
Copy link

Encountered the exact same error. Weirdly enough, it was working earlier in different device

@AK3847
Copy link

AK3847 commented Dec 31, 2024

The issue is that the NeMo library has not been maintained for the past 9 months while there have been major changes in the hugginface-hub repo, so you have to downgrade the package version which can lead to version conflict with other packages (transformers, datasets), I tried my best to find set of versions which would work, you can check out here: https://colab.research.google.com/drive/1umnew1cip7XnQkVJ3Edt1QtZB1ZRaaVK?authuser=1#scrollTo=0t9XnTTkjq5l&line=1&uniqifier=1

fix:

!pip install transformers==4.40.0
!pip install huggingface_hub==0.21.3
!pip install tokenizers>=0.21
!pip install datasets==2.19.0

@shripadalkar
Copy link
Author

shripadalkar commented Jan 3, 2025

@AK3847 Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants