Skip to content

Commit

Permalink
add logging messages
Browse files Browse the repository at this point in the history
  • Loading branch information
baberabb committed Oct 8, 2024
1 parent d7317d9 commit 2d3d694
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lm_eval/models/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,13 @@ def _get_backend(
# these special cases should be treated as seq2seq models.
self.AUTO_MODEL_CLASS = transformers.AutoModelForSeq2SeqLM
self.backend = "seq2seq"
eval_logger.info(f"Using model type '{backend}'")
elif (
getattr(self.config, "model_type") in MODEL_FOR_CAUSAL_LM_MAPPING_NAMES
):
self.AUTO_MODEL_CLASS = transformers.AutoModelForCausalLM
self.backend = "causal"
eval_logger.info(f"Using model type '{backend}'")
else:
if not trust_remote_code:
eval_logger.warning(
Expand All @@ -508,6 +510,9 @@ def _get_backend(
# then we default to AutoModelForCausalLM
self.AUTO_MODEL_CLASS = transformers.AutoModelForCausalLM
self.backend = "causal"
eval_logger.info(
f"Model type cannot be determined. Using default model type '{backend}'"
)

assert self.AUTO_MODEL_CLASS in [
transformers.AutoModelForCausalLM,
Expand Down

0 comments on commit 2d3d694

Please sign in to comment.