-
Notifications
You must be signed in to change notification settings - Fork 31.1k
Closed
somdipto/transformers
#1Closed
Copy link
Labels
Description
System Info
When i run pytest -rA tests/models/video_llama_3/test_modeling_video_llama_3.py::VideoLlama3ModelTest::test_generate_with_quant_cache, it will fail and return error:
pkg_name = 'optimum.quanto', return_version = True
def _is_package_available(pkg_name: str, return_version: bool = False) -> tuple[bool, str] | bool:
"""Check if `pkg_name` exist, and optionally try to get its version"""
spec = importlib.util.find_spec(pkg_name)
package_exists = spec is not None
package_version = "N/A"
if package_exists and return_version:
try:
# importlib.metadata works with the distribution package, which may be different from the import
# name (e.g. `PIL` is the import name, but `pillow` is the distribution name)
> distributions = PACKAGE_DISTRIBUTION_MAPPING[pkg_name]
E KeyError: 'optimum.quanto'
src/transformers/utils/import_utils.py:56: KeyError
I suggest one approach to solve this is add KeyError to except line in L61, is it OK?
Who can help?
@SunMarc FYI
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
- git clone https://github.com/huggingface/transformers.git
- pip install optimum-quanto
- export RUN_SLOW=1
- pytest -rA tests/models/video_llama_3/test_modeling_video_llama_3.py::VideoLlama3ModelTest::test_generate_with_quant_cache
Expected behavior
The test case is expected to pass.