Repository navigation
Exit with code 130 when unsloth train is stopped with Ctrl+C - #11151
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Confirmed the gap in unsloth_cli/commands/train.py where the KeyboardInterrupt path falls through to a 0 exit, and the 130 handling looks right. Could you drop the unrelated reformatting in studio/backend/main.py and the two test files so this stays just the exit-code change? |
…ai#11151) * CLI: exit 130 when unsloth train is stopped with Ctrl+C * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lyxot <[email protected]>
Pressing Ctrl+C during unsloth train saves a checkpoint and then exits with code 0, so a chained command like unsloth train -c cfg.yaml && unsloth export runs the export on a half-trained model.
The command now exits with 130 after the save. A normal finish still exits 0 and errors still exit 1. This covers both the CUDA trainer and the MLX adapter.
Tested with new unit tests and on a real GPU run: Ctrl+C at step 10 saved the checkpoint, exited 130 and the chained command did not run. A 3 step run still exits 0.