Skip to content

Commit

Permalink
Don't install the sigint handler
Browse files Browse the repository at this point in the history
  • Loading branch information
chiragjn committed May 2, 2024
1 parent b647482 commit 4e8264e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/axolotl/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ def terminate_handler(_, __, model_weakref):
sys.exit(0)

_model_weakref = weakref.ref(model)
signal.signal(
signal.SIGINT, lambda signum, frame: terminate_handler(signum, frame, _model_weakref)
)
# signal.signal(
# signal.SIGINT, lambda signum, frame: terminate_handler(signum, frame, _model_weakref)
# )

badge_markdown = """[<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)"""
transformers.modelcard.AUTOGENERATED_TRAINER_COMMENT += f"\n{badge_markdown}"
Expand Down Expand Up @@ -221,7 +221,7 @@ def terminate_handler(_, __, model_weakref):
if cfg.deepspeed:
trainer.deepspeed.destroy()
trainer.accelerator.free_memory()
trainer.model, trainer.optimizer = None, None
trainer.model, trainer.model_wrapped, trainer.optimizer = None, None, None

return model, tokenizer

Expand Down

0 comments on commit 4e8264e

Please sign in to comment.