Audio8-ASR-Infinite-Compressed / sources /scripts /select_mlx_q3_batch_v1.py
Reza2kn's picture
Lower Mac streaming batch size after separate paired qualification
52ecfff verified
Raw History Blame Contribute Delete
2.13 kB
from pathlib import Path
import json,hashlib
R=Path(__file__).resolve().parents[1];out=R/'reports/mlx-q3-batch-selection-v1/selection.json';assert not out.exists()
def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest()
items=[]
for batch,folder,report in [(4,'mlx-native-q3-stream-v1','verification.json'),(2,'mlx-native-q3-b2-exposed-v1','run.json'),(3,'mlx-native-q3-b3-exposed-v2','run.json')]:
d=R/'reports'/folder;x=json.loads((d/report).read_text());a=json.loads((d/'causal-alignment-audit.json').read_text());raw=[json.loads(l) for l in (d/'run.jsonl').open()];w=[q for q in raw if q['kind']=='caption_window' and q['segment']==18 and q['segment_index']>=375]
items.append(dict(batch=batch,report=str(d/report),report_sha256=sha(d/report),generated_ids_sha256=x['summary']['generated_ids_sha256'],word_errors=x['score']['counts'],matched_word_timing=x['score']['aligned_word_timing'],causal_timing_audit=a['same_session_unambiguous'],cross_reset_matches=len(a['cross_reset_textual_matches']),mature_work_rtf=sum(q['work_seconds'] for q in w)/(len(w)*.08)))
assert items[1]['generated_ids_sha256']==items[2]['generated_ids_sha256'];assert items[0]['generated_ids_sha256']!=items[1]['generated_ids_sha256'];assert all(x['word_errors']['errors']==179 for x in items)
out.write_text(json.dumps(dict(status='selected_for_fresh_qualification',selected_batch=2,selected_source_root='work/mlx-native-q3-v1',weights_unchanged=True,selection_data='Exposed AMI IS1000a only; reserved11 results not reused for selection',cases=items,reason='Batch2 and batch3 have identical tokens. All three batches have179/478 errors, but batch2/3 have one more deletion and one fewer insertion than batch4. Batch2 has the lowest delay and no >1 second same-session unambiguous match in this exposed diagnostic while mature RTF remains below1. Cross-reset textual matches remain unresolved recognition evidence, not latency successes. No universal pass inferred.',new_inputs=['data/continuous-v3/manifest.json','data/heldout-zh-v3/manifest.json'],selector_sha256=sha(Path(__file__)),production_ready=False),indent=2)+'\n');print(sha(out))