huggingface / lighteval

Lighteval is your all-in-one toolkit for evaluating LLMs across multiple backends
MIT License
689 stars 78 forks source link

[BUG]: lighteval.utils import is_autogptq_available not working #113

Closed fanminshi closed 6 months ago

fanminshi commented 6 months ago

Hi, It seems like lighteval.utils import is_autogptq_available differs the behavior from transformers.utils import is_auto_gptq_available even tho when auto-gptq is installed.

from transformers.utils import is_auto_gptq_available
from lighteval.utils import is_autogptq_available

print(is_auto_gptq_available())
print(is_autogptq_available())

import importlib
print(importlib.util.find_spec("auto-gptq"))
! pip list | grep "auto-gptq"

# Output
True
False
None
auto-gptq                 0.4.2
clefourrier commented 6 months ago

Hi! Thanks for the report! Note: ŧransformers uses the same check as we do (transformers vs lighteval) to test if a package is imported or not. It seems like there is a typo on our side, and we should check if importlib.util.find_spec("auto_gptq"), not auto-gptq.

clefourrier commented 6 months ago

Can you try this PR and tell us if it works for you?

fanminshi commented 6 months ago

will do!