Skip to content

Commit

Permalink
feat: Fix incorrect LM object check in evaluator
Browse files Browse the repository at this point in the history
The code changes in this commit fix a bug in the evaluator where the check for the LM object was incorrectly performed on the model object instead. This resulted in the LM object not being properly removed when it should have been. The fix ensures that the check is performed on the correct object, lm, and removes the LM object if it is not an instance of LM.

Remove not used txt writer
  • Loading branch information
Luodian committed Sep 6, 2024
1 parent 764d6bf commit 3ecdde7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lmms_eval/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def evaluate(
if hasattr(lm, "accelerator"):
lm.accelerator.wait_for_everyone()

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

return results_dict
Expand Down

0 comments on commit 3ecdde7

Please sign in to comment.