Skip to content

fix: add missing huggingface_hub dependency and pin transformers version#50

Open
AjayBandiwaddar wants to merge 1 commit intosugarlabs:mainfrom
AjayBandiwaddar:fix/requirements-huggingface-dependency
Open

fix: add missing huggingface_hub dependency and pin transformers version#50
AjayBandiwaddar wants to merge 1 commit intosugarlabs:mainfrom
AjayBandiwaddar:fix/requirements-huggingface-dependency

Conversation

@AjayBandiwaddar
Copy link

Problem

When installing dependencies fresh using pip install -r requirements.txt,
two issues occur:

  1. huggingface_hub is not listed in requirements.txt but is a required
    dependency of transformers. This causes an ImportError on fresh installs.

  2. transformers>=4.45.2 has no upper bound, which installs versions that
    conflict with huggingface_hub, breaking the application startup.

Fix

  • Added huggingface_hub>=0.26.5 explicitly to requirements.txt
  • Pinned transformers to <4.47.0 to prevent incompatible version installs

How to reproduce the bug

  1. Clone the repo fresh
  2. Run pip install -r requirements.txt
  3. Run python main.py
  4. See ImportError: cannot import name 'is_offline_mode' from 'huggingface_hub'

Testing

After this fix, python main.py starts successfully.

@AjayBandiwaddar
Copy link
Author

Problem

When installing dependencies fresh using pip install -r requirements.txt, two issues occur:

  1. huggingface_hub is not listed in requirements.txt but is a required
    dependency of transformers. This causes an ImportError on fresh installs.
  2. transformers>=4.45.2 has no upper bound, which installs versions that
    conflict with huggingface_hub, breaking the application startup.

Fix

  • Added huggingface_hub>=0.26.5 explicitly to requirements.txt
  • Pinned transformers to <4.47.0 to prevent incompatible version installs

How to reproduce the bug

  1. Clone the repo fresh
  2. Run pip install -r requirements.txt
  3. Run python main.py
  4. See ImportError: cannot import name 'is_offline_mode' from 'huggingface_hub'

Testing

After this fix, python main.py starts successfully.

Note: This PR was developed with AI assistance (Claude). As per Sugar Labs contributing guidelines, I'm disclosing this. The AI helped me structure the fix, but I verified, and tested each change myself.

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