Skip to content

Conversation

@gante
Copy link
Contributor

@gante gante commented Feb 24, 2025

What does this PR do?

Fixes #36244

The introduction of transformers-cli chat caused ANY cli call to depend on torch and rich, both optional requirements. This PR adds the appropriate import guards -- tested against a fresh venv with pip install -e . (no extras).

@Rocketknight1 we don't have tests for commands 👀 I'm going to defer it for now, as we probably need to review our commands for v5.

@gante gante requested a review from Rocketknight1 February 24, 2025 18:25
@gante gante added the for patch Tag issues / labels that should be included in the next patch label Feb 24, 2025
_gptqmodel_available = _is_package_available("gptqmodel")
# `importlib.metadata.version` doesn't work with `awq`
_auto_awq_available = importlib.util.find_spec("awq") is not None
_quanto_available = _is_package_available("quanto")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(unused var)

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@Rocketknight1 Rocketknight1 left a comment

Choose a reason for hiding this comment

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

Yes, LGTM and thanks for the quick fix!

@gante gante merged commit e1ce948 into huggingface:main Feb 25, 2025
23 checks passed
@gante gante deleted the fix_cli_requirements branch February 25, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

for patch Tag issues / labels that should be included in the next patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

transformers-cli now requires PyTorch

3 participants