Skip to content

Commit

Permalink
fix repeated cleanup (#399)
Browse files Browse the repository at this point in the history
Co-authored-by: Nathan Habib <[email protected]>
  • Loading branch information
anton-l and NathanHB authored Nov 20, 2024
1 parent c173871 commit 85c0d9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lighteval/models/vllm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def tokenizer(self):

def cleanup(self):
destroy_model_parallel()
del self.model.llm_engine.model_executor.driver_worker
if self.model is not None:
del self.model.llm_engine.model_executor.driver_worker
self.model = None
gc.collect()
ray.shutdown()
Expand Down

0 comments on commit 85c0d9f

Please sign in to comment.