Skip to content

Conversation

@Priyanshjain10
Copy link

…better error messaging

Fixes #42141

When loading models with AWQ quantization, users encountered unclear ModuleNotFoundError when the awq package structure didn't match expectations.

This fix wraps the awq module imports in try-except blocks and provides:

  • Clear error messages when imports fail
  • Information about which version/variant failed
  • Helpful installation instructions pointing to the llm-awq repository

The error handling catches ImportError, ModuleNotFoundError, and AttributeError to handle various failure modes:

  • Corrupted or incomplete awq installations
  • Version mismatches between autoawq and transformers
  • Missing or incompatible submodules

With these changes, users will receive helpful diagnostic information instead of cryptic import errors.

What does this PR do?

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Priyansh Jain added 2 commits November 12, 2025 16:53
…better error messaging

Fixes huggingface#42141

When loading models with AWQ quantization, users encountered unclear ModuleNotFoundError when the awq package structure didn't match expectations.

This fix wraps the awq module imports in try-except blocks and provides:
- Clear error messages when imports fail
- Information about which version/variant failed
- Helpful installation instructions pointing to the llm-awq repository

The error handling catches ImportError, ModuleNotFoundError, and AttributeError to handle various failure modes:
- Corrupted or incomplete awq installations
- Version mismatches between autoawq and transformers
- Missing or incompatible submodules

With these changes, users will receive helpful diagnostic information instead of cryptic import errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qwen3-vl ModuleNotFoundError: No module named 'awq.modules'; 'awq' is not a package

2 participants