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 Jun 3, 2024
1 parent 599aebe commit 766b38b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/axolotl/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ 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 @@ -236,7 +236,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 766b38b

Please sign in to comment.