kohya-ss / kohya-ss/sd-scripts
Feat. req: Save model on ctrl-c key press
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.2k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
Sample code to do this:
```
import signal
import sys
def signal_handler(sig, frame):
print('You pressed Ctrl+C!')
# Insert additional function execution here
run_before_exit()
sys.exit(0)
def run_before_exit():
print('Saving model before exiting.')
save_model_before_exiting()
signal.signal(signal.SIGINT, signal_handler)
```
This would be a great new feature and would allow to interrupt training without losing the trained model at that time.
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue provides a Python signal-handler example using SIGINT and describes saving the model before exiting training. Start by locating the training entry point and determining where model checkpoints are saved. Done means pressing Ctrl+C preserves the currently trained model before the process exits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100