status_snapshot.py
2.37 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python3
import argparse
import json
import subprocess
from pathlib import Path
root = Path.cwd()
workspace_root = root.parent
def sh(cmd):
return subprocess.check_output(cmd, shell=True, text=True).strip()
def build_snapshot():
return {
'latest_commit': sh('git log --oneline -n 1'),
'docs': {
'readme': str((workspace_root / 'docs/README.md').resolve()),
'handoff': str((workspace_root / 'docs/session-handoff.md').resolve()),
'workflow': str((workspace_root / 'docs/open-dataset-workflow.md').resolve()),
},
'drop_zones': {
'fma': str((root / 'data/raw/fma_small_audio').resolve()),
'mtg_jamendo': str((root / 'data/raw/mtg_jamendo_audio').resolve()),
},
'verified_open_smoke_dirs': {
'manifests': str((root / 'data/external_ingested/synthetic_as_open_fixed/fma/manifests').resolve()),
'reports': str((root / 'reports/open-smoke-fixed/fma').resolve()),
'one_shot_reports': str((root / 'data/external_smoke/fma_reports_smoke').resolve()),
},
'next_commands': {
'inspect_fma': '/usr/local/miniconda3/bin/python src/data/external_adapters.py inspect-local fma data/raw/fma_small_audio --eval-ratio 0.2 --query-duration 8.0',
'smoke_fma': '/usr/local/miniconda3/bin/python src/data/external_adapters.py smoke-local fma data/raw/fma_small_audio --output-root data/external_smoke --eval-ratio 0.2 --query-duration 8.0 --train-epochs 1 --batch-size 2',
'inspect_jamendo': '/usr/local/miniconda3/bin/python src/data/external_adapters.py inspect-local mtg_jamendo data/raw/mtg_jamendo_audio --eval-ratio 0.2 --query-duration 8.0',
'smoke_jamendo': '/usr/local/miniconda3/bin/python src/data/external_adapters.py smoke-local mtg_jamendo data/raw/mtg_jamendo_audio --output-root data/external_smoke --eval-ratio 0.2 --query-duration 8.0 --train-epochs 1 --batch-size 2'
}
}
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--output', default=None)
args = parser.parse_args()
snapshot = build_snapshot()
text = json.dumps(snapshot, ensure_ascii=False, indent=2)
if args.output:
out = Path(args.output)
out.parent.mkdir(parents=True, exist_ok=True)
out.write_text(text)
print(text)
if __name__ == '__main__':
main()