Download progress.py from apetersson/v41-quant-worker: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/datasets/apetersson/v41-quant-worker/resolve/main/progress.py
- Command line
-
hf download hf://datasets/apetersson/v41-quant-worker/progress.py
-
curl -L -o progress.py https://huggingface.co/datasets/apetersson/v41-quant-worker/resolve/main/progress.py
1.24 kB
| import datetime, glob, json, os | |
| out = '/workspace/v41-quant/q2-iq2-20260910' | |
| plan = json.load(open(out + '/plan.json')) | |
| shards = plan['shards'] | |
| total_q = sum(sum(t['out_bytes'] for t in s['tensors'] if t['role'] == 'quantised') for s in shards) | |
| files = sorted(glob.glob(out + '/*.complete'), key=os.path.getmtime) | |
| done = [os.path.basename(f).replace('.complete', '') for f in files] | |
| q = sum(sum(t['out_bytes'] for t in s['tensors'] if t['role'] == 'quantised') for s in shards if s['output_shard'] in done) | |
| m = [os.path.getmtime(f) for f in files] | |
| recent = [m[j + 1] - m[j] for j in range(max(0, len(m) - 6), len(m) - 1)] | |
| cad = sum(recent) / len(recent) if recent else 0.0 | |
| now = datetime.datetime.now(datetime.timezone.utc) | |
| eta_s = cad * (len(shards) - len(done)) | |
| abs_t = (now + datetime.timedelta(seconds=eta_s)).strftime('%H:%M') | |
| size = sum(os.path.getsize(out + '/' + s['output_shard']) for s in shards if os.path.exists(out + '/' + s['output_shard'])) | |
| total_bytes = sum(s['data_bytes'] for s in shards) | |
| print(f"{now.strftime('%H:%M:%S')}Z shards {len(done)}/{len(shards)} {q / total_q * 100:.1f}% of quantised bytes " | |
| f"{size / 1e9:.1f}/{total_bytes / 1e9:.1f} GB cadence {cad:.0f}s/shard ETA {eta_s / 60:.0f} min -> ~{abs_t}Z") | |