Skip to content

Comments

fix: add required python packages to support generic huggingface models#1781

Open
andyzhangx wants to merge 4 commits intokaito-project:mainfrom
andyzhangx:add-required-packages
Open

fix: add required python packages to support generic huggingface models#1781
andyzhangx wants to merge 4 commits intokaito-project:mainfrom
andyzhangx:add-required-packages

Conversation

@andyzhangx
Copy link
Collaborator

@andyzhangx andyzhangx commented Feb 21, 2026

Reason for Change:

fix: add required python packages to support generic huggingface models

  • decord is required by 'baidu/ernie-4.5-vl-28b-a3b-pt'
  • transformers>=4.57.1 is required by zai-org/GLM-4.1V-9B-Thinking
  • timm is required by 'google/gemma-3n-e2b-it'
  • torch-c-dlpack-ext is required by 'deepseek-ai/DeepSeek-V3.1' and 'ai21labs/ai21-jamba-1.5-mini' and a lot of other models
  • num2words is required by 'HuggingFaceTB/SmolVLM2-2.2B-Instruct'
  • mistral-common[soundfile] is required by mistralai/Voxtral-Mini-3B-2507
  • tensorflow is required by 'allenai/Molmo-7B-D-0924'
  • fla-core is required by moonshotai/Kimi-Linear-48B-A3B-Instruct

Requirements

  • added unit tests and e2e tests (if applicable).

Issue Fixed:

Notes for Reviewers:

@kaito-pr-agent
Copy link

Title

Add required Python packages to support generic HuggingFace models


Description

  • Update transformers version constraint to >=4.57.1

  • Add required dependencies for vision and audio models support

  • Include decord, timm, torch-c-dlpack-ext, mistral-common[soundfile], num2words, fla-core, and tensorflow

  • Enable compatibility with various HuggingFace models (ERNIE, GLM, Gemma, DeepSeek, etc.)


Changes walkthrough 📝

Relevant files
Dependencies
requirements.txt
Update dependencies for HuggingFace model compatibility   

presets/workspace/dependencies/requirements.txt

  • Updated transformers version from >=4.56.0 to >=4.57.1
  • Added decord for video processing support
  • Added fla-core for flash attention mechanisms
  • Added mistral-common[soundfile] for audio model support
  • Added num2words for number-to-text conversion
  • Added tensorflow as a dependency
  • Added timm for image models
  • Added torch-c-dlpack-ext for tensor operations
  • +10/-1   

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @kaito-pr-agent
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Missing version constraints

    Newly added packages (decord, fla-core, num2words, tensorflow, timm, torch-c-dlpack-ext) lack version pinning or upper bounds. This could lead to future breaking changes or incompatible dependency versions. Consider adding minimum version constraints and/or upper bounds for reproducible builds.

    decord
    fla-core
    mistral-common[soundfile]
    num2words
    tensorflow
    timm
    torch-c-dlpack-ext
    
    TensorFlow compatibility concerns

    Adding tensorflow alongside torch (PyTorch) may significantly increase the container image size and could introduce CUDA/cuDNN version conflicts. Verify compatibility between TensorFlow, PyTorch 2.9.0, and CUDA versions used by vLLM 0.12.0 to avoid runtime errors.

    tensorflow
    

    Copy link
    Contributor

    Copilot AI left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Pull request overview

    Updates the workspace Python dependency set used by KAITO’s TFS/vLLM preset images to support additional “generic” Hugging Face models that require extra third‑party packages.

    Changes:

    • Bumps the minimum transformers version to >=4.57.1,<5.
    • Adds several new model-specific Python dependencies (e.g., decord, timm, torch-c-dlpack-ext, etc.) to the shared requirements.

    💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

    @kaito-pr-agent
    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Constrain TensorFlow version

    TensorFlow is a heavy dependency that can conflict with PyTorch 2.9.0 regarding
    CUDA/cuDNN versions. Pin to a compatible version range (e.g., >=2.15.0,<2.19.0) to
    avoid runtime conflicts, control image size, and ensure compatibility with the
    existing Python environment.

    presets/workspace/dependencies/requirements.txt [40]

    -tensorflow
    +tensorflow>=2.15.0,<2.19.0
    Suggestion importance[1-10]: 8

    __

    Why: The suggestion accurately highlights a specific technical risk where tensorflow can conflict with PyTorch 2.9.0 regarding CUDA/cuDNN versions. Pinning this heavy dependency is critical to avoid runtime failures and control image size.

    Medium
    Pin versions for reproducibility

    Add version constraints to all new dependencies to prevent breaking changes and
    ensure reproducible builds. Unpinned packages may auto-update to versions
    incompatible with the pinned torch==2.9.0 and vllm==0.12.0, causing runtime failures
    or installation conflicts.

    presets/workspace/dependencies/requirements.txt [35-42]

     # Required by specific vLLM models
    -decord
    -fla-core
    -mistral-common[soundfile]
    -num2words
    -tensorflow
    -timm
    -torch-c-dlpack-ext
    +decord>=0.6.0,<1.0
    +fla-core>=0.1.0
    +mistral-common[soundfile]>=1.0.0,<2.0
    +num2words>=0.5.0
    +tensorflow>=2.15.0,<2.19.0
    +timm>=0.9.0,<1.0
    +torch-c-dlpack-ext>=1.0.0
    Suggestion importance[1-10]: 7

    __

    Why: The suggestion correctly identifies that adding unpinned dependencies risks breaking changes and installation conflicts with pinned packages like torch==2.9.0 and vllm==0.12.0. Adding version constraints is important for build reproducibility.

    Medium

    @zhuangqh
    Copy link
    Collaborator

    can you pin these dependencies version? This kind of py deps are easily broken.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    Status: No status

    Development

    Successfully merging this pull request may close these issues.

    2 participants