Fix CLI/tooling robustness gaps and dedupe the Conditioning enum
- run_create_manifest gains --force; it previously overwrote an existing manifest (including holdout.manifest, which check_holdout_overlap exists specifically to protect) with no warning or backup on a second run. - _git_user_name only caught OSError, not subprocess.TimeoutExpired (a SubprocessError, not an OSError) — a slow/loaded shared portal machine could crash `dwarf bump-gen`/`bump-schema` instead of degrading to by=None as intended. - `dwarf convert --jobs`/`make-root --jobs` now warn (never block) when the requested count exceeds ~1/4 of the machine's CPUs, matching the same shared-machine etiquette check added to giant train in the previous commit. - The Conditioning enum was independently redefined in both giant/cli.py and scripts/dwarf.py; moved to a single giant.config.Conditioning both now import, removing the drift risk of a third conditioning mode being added to one but not the other. Each fix has a regression test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+4
-3
@@ -211,9 +211,10 @@ class Mode(str, Enum):
|
||||
wgan = "wgan"
|
||||
|
||||
|
||||
class Conditioning(str, Enum):
|
||||
physical = "physical"
|
||||
embedding = "embedding"
|
||||
# Conditioning itself lives in giant.config (imported below as gconfig) —
|
||||
# shared with scripts/dwarf.py's Typer commands so the two CLIs can't
|
||||
# silently drift apart on the option's valid values.
|
||||
Conditioning = gconfig.Conditioning
|
||||
|
||||
|
||||
class Coord(str, Enum):
|
||||
|
||||
@@ -4,11 +4,23 @@ import subprocess
|
||||
import sys
|
||||
import tomllib
|
||||
from datetime import datetime, timezone
|
||||
from enum import Enum
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
|
||||
class Conditioning(str, Enum):
|
||||
"""`model.conditioning` choices — shared by `giant.cli` and `scripts.dwarf`'s
|
||||
Typer commands so the two CLIs can't silently drift apart on the option's
|
||||
valid values (see DEFAULT_CONFIG["model"]["conditioning"] for what each
|
||||
value means)."""
|
||||
|
||||
physical = "physical"
|
||||
embedding = "embedding"
|
||||
|
||||
|
||||
DEFAULT_CONFIG: dict = {
|
||||
"train": {
|
||||
"mode": "flow",
|
||||
|
||||
Reference in New Issue
Block a user