Sync 16 Oct: current log leaves for every paper; statuses (Mozilla replies, RIPE answer, FCC and CVE Secretariat questions, Pixel backfill); files/ resynced from GitHub e186db8 (SM-001, SM-014, SM-017, SM-018, SM-019)
03a75ff verified Download upload.py from MarkovianProtocol/second-measurements: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/datasets/MarkovianProtocol/second-measurements/resolve/main/upload.py
- Command line
-
hf download hf://datasets/MarkovianProtocol/second-measurements/upload.py
-
curl -L -o upload.py https://huggingface.co/datasets/MarkovianProtocol/second-measurements/resolve/main/upload.py
1.04 kB
| #!/usr/bin/env python3 | |
| """Push ~/second-measurements/hf to the dataset MarkovianProtocol/second-measurements. | |
| Run: python3 ~/second-measurements/hf/upload.py | |
| Token: HF_TOKEN in the environment, else ~/.secrets/hf_token.txt, else the saved login.""" | |
| import os, sys | |
| from huggingface_hub import HfApi | |
| tok = os.environ.get("HF_TOKEN") | |
| if not tok and os.path.exists(os.path.expanduser("~/.secrets/hf_token.txt")): | |
| tok = open(os.path.expanduser("~/.secrets/hf_token.txt")).read().strip() | |
| api = HfApi(token=tok or None) | |
| me = api.whoami()["name"] | |
| rows = sum(1 for l in open(os.path.expanduser("~/second-measurements/hf/measurements.jsonl")) if l.strip()) | |
| r = api.upload_folder(folder_path=os.path.expanduser("~/second-measurements/hf"), repo_id="MarkovianProtocol/second-measurements", | |
| repo_type="dataset", ignore_patterns=["upload.py", "*.bak*", ".DS_Store"], | |
| commit_message=f"SM-019 questions sent, leaf 10060; {rows} rows") | |
| print("as", me, "->", r.commit_url if hasattr(r, "commit_url") else r) | |