Spaces:
Running
Running
Commit History
-
feat: add global debug switch and unified debug logging system
Alex W.- Global configuration module - DEBUG = False (default: silent) - Single line to toggle all debug output across entire codebase - Unified debug output utilities - dlog(lines, msg): appends [DEBUG] msg to UI log list (for metrics/analyze) - dprint(msg): prints to stdout (for fetcher, no access to lines) - Both functions are no-ops when DEBUG=False, zero performance impact - Replaced all print() with dprint() - Debug info covered: - tensor_name, shape, dtype - data_offsets (raw and absolute) - expected_bytes vs actual_bytes check ✅/❌ - first 8 bytes hex (for cross-validation with local file reader) - result[0,:5] (first row sanity check) - All controlled by DEBUG switch, zero output in production - Replaced all log.append("[DEBUG]...") with dlog(lines, ...) - Debug info covered: - key_q / key_k / key_v (full key names) - W_q / W_k / W_v shapes - n_q / n_kv / group / d_head / head_dim_source - W_k[0,:10] / W_q[0,:10] raw weights (for cross-validation) - Per KV head:…0105df7