Skip to content

Commit 511012a

Browse files
committed
Add run-cmd.bat and update README.md accordingly.
1 parent 1c50e81 commit 511012a

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,11 @@ All functionality is split into different scripts located in the `scripts` direc
9999
- `generate_masks.py` A utility to automatically create masks for your dataset
100100
- `calculate_loss.py` A utility to calculate the training loss of every image in your dataset
101101

102-
To learn more about the different parameters, execute `<script-name> -h`. For example `python scripts\train.py -h`. An example of running training scripts on windows is:
102+
To learn more about the different parameters, execute `./run-cmd.sh <script-name> -h`. For example `./run-cmd.sh scripts/train -h`. On Windows, you can do `run-cmd.bat <script-name> -h`. An example of running training scripts on Windows is:
103103

104-
`pixi run --locked -e cuda python "C:\repos\OneTrainer\scripts\train.py" --config-path ./config.json`
104+
```sh
105+
run-cmd.bat train --config-path ./config.json
106+
```
105107

106108
You can also activate a shell, you'd select your gpu env (usually `cuda`: https://pixi.prefix.dev/latest/advanced/pixi_shell/
107109

run-cmd.bat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@echo off
2+
chcp 65001 >nul
3+
cd /d "%~dp0"
4+
powershell -ExecutionPolicy Bypass -File "%~dp0scripts\powershell\run-cmd.ps1" %*
5+
set "_EXIT=%ERRORLEVEL%"
6+
pause
7+
exit /b %_EXIT%

scripts/powershell/run-cmd.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
. "$PSScriptRoot\lib.include.ps1"
2+
3+
Prepare-RuntimeEnvironment
4+
5+
Invoke-InEnv python "scripts/@args[1].py" @args[1..]

0 commit comments

Comments
 (0)