Skip to content

Sync huggingface-transformers with the updated tutorial - #882

Merged
martin-martin merged 2 commits into
masterfrom
maintenance/huggingface-transformers-20261009
Oct 9, 2026
Merged

martin-martin merged 2 commits into
masterfrom
maintenance/huggingface-transformers-20261009

Conversation

@realpython-bot

@realpython-bot realpython-bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Maintenance sync for Hugging Face Transformers: Leverage Open-Source AI in Python. The article's update draft re-pins its dependencies to Transformers 5.

Changes

  • requirements.txt: transformers 4.42.4 → 5.19.0, torch 2.3.1 → 2.14.1, accelerate 0.32.1 → 1.15.0, polars 1.2.0 → 2.0.0. Added tqdm==4.70.1 because the notebook imports it directly, and pillow==12.3.0 because the image pipeline needs it.
  • pyproject.toml: bumped the same constraints, plus pillow ^12.3.0, notebook ^7.6.3 and ipywidgets ^8.1.9. The Python floor goes from ^3.12 to ^3.10, the real minimum: every pinned package needs >=3.10, and vermin reports 3.6 for the code.
  • poetry.lock: regenerated with Poetry 2.5.1.
  • README.md: pinned the pip install line to the tested versions.
  • running_pipelines.py: changed "HuggingFace" to "Hugging Face" in the first example sentence. The script used different text than the article, so it printed a different score.

Verification (Python 3.14, CPU torch, fresh venv from requirements.txt alone)

  • auto_classes.py and running_pipelines.py run cleanly. Every printed value now matches the updated article, including the first sentiment score and the llama prediction.
  • I ran the notebook's non-GPU cells (CSV load with Polars 2, time_text_classifier() on a CPU pipeline). I couldn't run the GPU cells because there's no GPU here.
  • ruff@0.14.1 format --check and ruff check pass.

Links

🤖 Generated with Claude Code

realpython-bot and others added 2 commits October 9, 2026 11:48
…Face Transformers: Leverage Open-Source AI in Python

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- running_pipelines.py: use "Hugging Face" in the first example sentence so
  the printed score matches the tutorial (0.9863850474357605).
- requirements.txt: add pillow==12.3.0, needed by the image pipeline.
- README.md: pin the pip install line to the tested versions.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@martin-martin
martin-martin merged commit 1c2d0b2 into master Oct 9, 2026
1 check passed
@martin-martin
martin-martin deleted the maintenance/huggingface-transformers-20261009 branch October 9, 2026 12:46
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.

2 participants