[2026-05-28] 학습 파이프라인 실행 로그 수정
This commit is contained in:
@@ -19,13 +19,19 @@ function Write-Log {
|
||||
function Invoke-PythonStep {
|
||||
param(
|
||||
[string]$Name,
|
||||
[string[]]$Args,
|
||||
[string[]]$StepArgs,
|
||||
[bool]$Required = $true
|
||||
)
|
||||
|
||||
Write-Log $Name
|
||||
& $Python @Args *>> $LogPath
|
||||
$PreviousErrorActionPreference = $ErrorActionPreference
|
||||
$ErrorActionPreference = "Continue"
|
||||
$Output = & $Python @StepArgs 2>&1
|
||||
$ErrorActionPreference = $PreviousErrorActionPreference
|
||||
$Code = $LASTEXITCODE
|
||||
foreach ($Line in $Output) {
|
||||
Add-Content -Path $LogPath -Value $Line -Encoding UTF8
|
||||
}
|
||||
if ($Code -ne 0) {
|
||||
$Message = "$Name failed with exit code $Code"
|
||||
if ($Required) {
|
||||
@@ -43,14 +49,14 @@ if ($LASTEXITCODE -ne 0) {
|
||||
exit 0
|
||||
}
|
||||
|
||||
Invoke-PythonStep -Name "collecting daily market features" -Args @("scripts\collect_daily_features.py") -Required $false
|
||||
Invoke-PythonStep -Name "collecting daily market features" -StepArgs @("scripts\collect_daily_features.py") -Required $false
|
||||
|
||||
Invoke-PythonStep -Name "collecting KIS minute data" -Args @("scripts\collect_minute_data.py", "--top", "30", "--real-quotes") -Required $false
|
||||
Invoke-PythonStep -Name "collecting KIS minute data" -StepArgs @("scripts\collect_minute_data.py", "--top", "30", "--real-quotes") -Required $false
|
||||
|
||||
Invoke-PythonStep -Name "exporting bot training dataset" -Args @("scripts\export_training_dataset.py", "data\training_dataset.csv") -Required $true
|
||||
Invoke-PythonStep -Name "exporting bot training dataset" -StepArgs @("scripts\export_training_dataset.py", "data\training_dataset.csv") -Required $true
|
||||
|
||||
Invoke-PythonStep -Name "building external training dataset" -Args @("scripts\build_external_training_dataset.py", "--out", "data\external_training_dataset.csv", "--all-minutes") -Required $true
|
||||
Invoke-PythonStep -Name "building external training dataset" -StepArgs @("scripts\build_external_training_dataset.py", "--out", "data\external_training_dataset.csv", "--all-minutes") -Required $true
|
||||
|
||||
Invoke-PythonStep -Name "training model" -Args @("scripts\train_ai_model.py") -Required $true
|
||||
Invoke-PythonStep -Name "training model" -StepArgs @("scripts\train_ai_model.py") -Required $true
|
||||
|
||||
Write-Log "training pipeline finished"
|
||||
|
||||
Reference in New Issue
Block a user