Skip to content

transformers-cli now requires PyTorch #36244

Description

@setu4993

System Info

N/A

Who can help?

@gante (author of #35714)

Reproduction

uv run --python 3.12 --with transformers transformers-cli --help

Expected behavior

Since #35714 (released in v4.49.0), the transformers-cli now requires PyTorch to even run a simple: transformers-cli --help command.

I am pretty sure it is originating from this line.

My question is if this is intentional or unintentional. So far, PyTorch has been an optional dependency for any functionality with CLI or the package itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions