Download upload.sh from microscope-project/microscope-data: direct link, hf CLI and curl.
- Browser
- Download file 822 Bytes
-
https://huggingface.co/datasets/microscope-project/microscope-data/resolve/e8900a3baad63df9982103ce898d39b602294983/upload.sh
- Command line
-
hf download hf://datasets/microscope-project/microscope-data@e8900a3baad63df9982103ce898d39b602294983/upload.sh
-
curl -L -o upload.sh https://huggingface.co/datasets/microscope-project/microscope-data/resolve/e8900a3baad63df9982103ce898d39b602294983/upload.sh
822 Bytes
| # Uploads new images to Hugging Face repo every 5 minutes if there are changes. | |
| # Usage: Go to terminal, go to microscope-data directory, and run `./upload.sh` | |
| # If you don't want computer to turn off during long uploads: | |
| # systemd-inhibit bash upload.sh | |
| #!/bin/bash | |
| INTERVAL=310 | |
| while true; do | |
| if [[ -n $(git status --porcelain) ]]; then | |
| echo "[$(date)] Adding and committing..." | |
| git add . | |
| git commit -m "Add splats batch $(date +%Y%m%d_%H%M%S)" | |
| else | |
| echo "[$(date)] Nothing new to commit." | |
| fi | |
| echo "[$(date)] Pushing..." | |
| push_output=$(git push 2>&1) | |
| echo "$push_output" | |
| if echo "$push_output" | grep -q "Everything up-to-date"; then | |
| echo "[$(date)] All done, everything is up to date!" | |
| break | |
| fi | |
| echo "[$(date)] Waiting ${INTERVAL}s..." | |
| sleep $INTERVAL | |
| done |