command to start sagemaker training

include sample training
This commit is contained in:
2026-05-25 16:48:31 -04:00
parent 62ffe163e8
commit 0e728cc193
13 changed files with 796 additions and 5 deletions

30
src/state.py Normal file
View File

@@ -0,0 +1,30 @@
import json
from pathlib import Path
from typing import Any
STATE_FILE = ".qc-cli.json"
def _path(config_dir: str) -> Path:
return Path(config_dir) / STATE_FILE
def read_state(config_dir: str = ".") -> dict[str, Any]:
path = _path(config_dir)
if not path.exists():
return {}
with open(path) as f:
return json.load(f)
def write_state(config_dir: str = ".", **updates: str | None) -> None:
path = _path(config_dir)
state = read_state(config_dir)
state.update(updates)
with open(path, "w") as f:
json.dump(state, f, indent=2)
def get_last_training_job(config_dir: str = ".") -> str | None:
value = read_state(config_dir).get("last_training_job")
return str(value) if value else None