Spaces:
Runtime error
Runtime error
Commit History
-
Handle empty dataset repo in _list_existing_files
Catch the 404 EntryNotFoundError thrown when the repo has no commits yet (data/ path does not exist on main), log it, and return [] so the first commit can proceed normally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>3ef5c36
-
Batch log uploads to avoid HF 256-commits/hour rate limit
Replaces per-inference commit (prune + upload = 2 commits) with a LogUploader class that queues parquet files locally and flushes them in a single batched commit every LOG_BATCH_INTERVAL seconds (default 60). At full load this reduces commit rate from O(requests) to ~1/minute. Also splits _build_commit_ops into _build_add_ops and _build_delete_ops so each helper has a single responsibility, and updates tests accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>2f63460 -
Prune log files before uploading, not after
The upload was failing with the 10k-files-per-directory error because pruning ran after the upload attempt. Moving prune first clears space so the new file can always be written. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>bc828ab -
Switch log pruning from time-based to count-based
Replaces LOG_MAX_DAYS (delete files older than N days) with LOG_MAX_FILES (keep only the N most recent files, default 5000), preventing the HuggingFace 10k-files-per-directory hard limit from being hit. Deletions are batched into a single create_commit call using CommitOperationDelete instead of one delete_file call per file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>c149547
-
Add per-section timing to log_inference
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>0ce14db -
Time log_inference and print elapsed duration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>b59fe84 -
Log temp file cleanup failures instead of silently swallowing them
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>34c8646 -
Squash git history daily to free LFS storage from pruned files
api.delete_file only removes file pointers from the current tree; the LFS objects remain referenced in prior commits. _maybe_squash_history calls super_squash_history once per day (throttled via a marker file at metadata/last_squash.txt) to collapse history into one commit, making deleted LFS objects eligible for GC within 36 hours. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>0597d39 -
Extract _make_path as single source of truth for parquet file naming
Previously the naming format was duplicated between log_inference and the contract test. _make_path centralises it so any change to the format is caught immediately by test_file_date_matches_make_path. The _file helper in tests also uses _make_path to stay consistent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>9235827 -
Pass now to _prune_old_files for deterministic boundary testing
Mirrors the same pattern used by _build_table. Tests now use a fixed NOW constant and relative offsets, enabling precise boundary checks (exactly keep_days old is kept, keep_days+1 is deleted). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>818b129 -
Auto-prune log files older than LOG_MAX_DAYS (default 7) after each upload
Without pruning, parquet files accumulate indefinitely and risk exceeding the HF private storage free tier. After each successful upload, old files are deleted from the dataset repo using a date-prefix comparison on the filename. Refactors log_inference into single-responsibility helpers (_img_to_jpeg, _build_table, _upload_parquet, _prune_old_files) to make the prune logic unit-testable without real network calls or waiting. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>ca0e7d6 -
Write one parquet file per inference to avoid Git LFS version bloat
Previously the logger downloaded and rewrote the same daily parquet file on every inference, creating a new LFS object each time and inflating private storage far beyond the actual data size. Now each inference writes a uniquely-named file (data/YYYY-MM-DD-HHMMSS-{uid}.parquet) that is committed once and never overwritten. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>9e47f62
-
Change timestamp column from ISO string to Unix float64
Enables numeric sorting on the HF dataset viewer. Dataset repo has been reset so there are no legacy string-typed rows to conflict. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>4883dd8 -
Log reason when inference logging is skipped
Prints which env var is missing instead of returning silently, making it easier to diagnose missing HF_TOKEN or LOG_DATASET_REPO. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>b886ed1 -
Move logging logic into logging_utils.py
Extracts log_inference and its _readme_from_features helper out of app.py into a dedicated module, keeping app.py focused on the Gradio UI and inference pipeline. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>8e461ed