Back to all reviewers

Version AI dependencies appropriately

huggingface/tokenizers
Based on 2 comments
Toml

When adding or updating dependencies for AI/ML libraries in your project, follow these two key practices: 1. **Set appropriate version constraints** that balance stability with access to improvements. For rapidly evolving AI libraries like HuggingFace Hub, avoid overly restrictive upper bounds that prevent compatible updates, but also avoid excessively...

AI Toml

Reviewer Prompt

When adding or updating dependencies for AI/ML libraries in your project, follow these two key practices:

  1. Set appropriate version constraints that balance stability with access to improvements. For rapidly evolving AI libraries like HuggingFace Hub, avoid overly restrictive upper bounds that prevent compatible updates, but also avoid excessively permissive constraints that risk breaking changes.
# Too restrictive
dependencies = ["huggingface_hub>=0.16.4,<0.17"]

# Better approach - allows minor version updates
dependencies = ["huggingface_hub>=0.16.4,<0.18"]

# Potentially too permissive for rapidly evolving AI libraries
dependencies = ["huggingface_hub>=0.16.4,<1.0"]
  1. Make AI-related dependencies optional when they’re not essential for core functionality. This is especially important for dependencies fetched from Git repositories or those with large footprints.
# Better approach with optional flag
arrow = { git = "https://github.com/apache/arrow-rs", branch = "master", features = [
    "pyarrow",
], optional=True }

This approach reduces unnecessary dependencies for users who don’t need all ML features and provides flexibility in environments with compatibility constraints.

2
Comments Analyzed
Toml
Primary Language
AI
Category

Source Discussions