Skip to content

Commit

Permalink
empry cache
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Mar 6, 2024
1 parent b0818c0 commit 8fcd85f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions optimum_benchmark/backends/py_txi/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def create_no_weights_model(self) -> None:
)
LOGGER.info("\t+ Saving no weights model")
self.pretrained_model.save_pretrained(save_directory=self.no_weights_model)
del self.pretrained_model
torch.cuda.empty_cache()

if self.config.task in TEXT_GENERATION_TASKS:
LOGGER.info("\t+ Modifying generation config for fixed length generation")
Expand Down

0 comments on commit 8fcd85f

Please sign in to comment.