-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.ps1
More file actions
39 lines (32 loc) · 1011 Bytes
/
run.ps1
File metadata and controls
39 lines (32 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# PowerShell Script for Energic Model Management
$PYTHON_PATH = "python"
$MODEL_SCRIPT = "main.py"
$TRAIN_SCRIPT = "nlp/train_ebt.py"
function Show-Help {
Write-Host "Available commands:"
Write-Host " train - Train the model"
Write-Host " run - Run the main model"
Write-Host " clean - Clean __pycache__ directories"
Write-Host " help - Show this help message"
}
function Start-Training {
Write-Host "Starting model training..."
& $PYTHON_PATH $TRAIN_SCRIPT
}
function Start-Model {
Write-Host "Running the model..."
& $PYTHON_PATH $MODEL_SCRIPT
}
function Clear-Cache {
Write-Host "Cleaning Python cache files..."
Get-ChildItem -Path .\ -Include "__pycache__" -Directory -Recurse | Remove-Item -Recurse -Force
Write-Host "Cache cleaned successfully!"
}
# Parse command line arguments
$command = $args[0]
switch ($command) {
"train" { Start-Training }
"run" { Start-Model }
"clean" { Clear-Cache }
default { Show-Help }
}