Skip to content

Commit

Permalink
chore: Remove unused LM object if model is not an instance of LM
Browse files Browse the repository at this point in the history
  • Loading branch information
Luodian committed Sep 5, 2024
1 parent aa3abf0 commit f7111b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lmms_eval/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,10 @@ def evaluate(

if hasattr(lm, "accelerator"):
lm.accelerator.wait_for_everyone()

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

return results_dict


Expand Down

0 comments on commit f7111b6

Please sign in to comment.