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
Tasks
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.
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:
I suggest one approach to solve this is add
KeyErrorto except line in L61, is it OK?Who can help?
@SunMarc FYI
Information
Tasks
examplesfolder (such as GLUE/SQuAD, ...)Reproduction
Expected behavior
The test case is expected to pass.