Matthew Ford commited on
Commit ·
f916efb
1
Parent(s): 719571d
pimt v9 allow hf registry db path
Browse filesFormer-commit-id: 6da3c78980636e0fbd5865946270cc701f031754
Former-commit-id: 1acee3e3251d231b80bbad42c3c2f8f7c88efdbb
scripts/pimt_v9_train_publish.py
CHANGED
|
@@ -88,9 +88,17 @@ def load_payload(fetch_pubchem: bool) -> dict[str, Any]:
|
|
| 88 |
target_path = train.POUCHER_TARGET_PATH.resolve()
|
| 89 |
if not target_path.is_file():
|
| 90 |
raise FileNotFoundError(f"Target file missing; aborting instead of empty fallback: {target_path}")
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
if not registry_path.is_file() or registry_path.stat().st_size == 0:
|
| 93 |
raise FileNotFoundError(f"Registry DB missing; refusing to create an empty registry: {registry_path}")
|
|
|
|
| 94 |
target_rows = train.load_poucher_targets(target_path)
|
| 95 |
measured = [_finite_float(row.get("poucher_coefficient")) for row in target_rows]
|
| 96 |
measured = [value for value in measured if value is not None and value > 0]
|
|
|
|
| 88 |
target_path = train.POUCHER_TARGET_PATH.resolve()
|
| 89 |
if not target_path.is_file():
|
| 90 |
raise FileNotFoundError(f"Target file missing; aborting instead of empty fallback: {target_path}")
|
| 91 |
+
registry_candidates = [
|
| 92 |
+
Path(os.environ["PINO_REGISTRY_PATH"]) if os.environ.get("PINO_REGISTRY_PATH") else None,
|
| 93 |
+
Path("src/pino/registry.db"),
|
| 94 |
+
Path("data/pimt_v9_registry.db"),
|
| 95 |
+
]
|
| 96 |
+
registry_path = next((path.resolve() for path in registry_candidates if path and path.is_file()), None)
|
| 97 |
+
if registry_path is None:
|
| 98 |
+
registry_path = Path(os.environ.get("PINO_REGISTRY_PATH", "src/pino/registry.db")).resolve()
|
| 99 |
if not registry_path.is_file() or registry_path.stat().st_size == 0:
|
| 100 |
raise FileNotFoundError(f"Registry DB missing; refusing to create an empty registry: {registry_path}")
|
| 101 |
+
os.environ["PINO_REGISTRY_PATH"] = str(registry_path)
|
| 102 |
target_rows = train.load_poucher_targets(target_path)
|
| 103 |
measured = [_finite_float(row.get("poucher_coefficient")) for row in target_rows]
|
| 104 |
measured = [value for value in measured if value is not None and value > 0]
|