Skip to content

Commit

Permalink
Stricted 'lm' object to be deleted only if it wasn't an already-initi…
Browse files Browse the repository at this point in the history
…alized model
  • Loading branch information
ahmedamrelhefnawy committed Sep 4, 2024
1 parent fb23b3f commit 630bba4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lm_eval/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,15 @@ def _adjust_config(task_dict):
add_env_info(results) # additional environment info to results
add_tokenizer_info(results, lm) # additional info about tokenizer

del lm
if not isinstance(model, lm_eval.api.model.LM):
del lm

return results
else:

del lm
if not isinstance(model, lm_eval.api.model.LM):
del lm

return None


Expand Down

0 comments on commit 630bba4

Please sign in to comment.