Download load_existing_annotations.py from sschellhammer/reddit_climate_random_full: direct link, hf CLI and curl.
- Browser
- Download file 537 Bytes
-
https://huggingface.co/spaces/sschellhammer/reddit_climate_random_full/resolve/main/load_existing_annotations.py
- Command line
-
hf download hf://spaces/sschellhammer/reddit_climate_random_full/load_existing_annotations.py
-
curl -L -o load_existing_annotations.py https://huggingface.co/spaces/sschellhammer/reddit_climate_random_full/resolve/main/load_existing_annotations.py
537 Bytes
| import os | |
| from dotenv import load_dotenv | |
| from huggingface_hub import snapshot_download | |
| load_dotenv("/app/config.env") | |
| HF_TOKEN = os.environ["HF_TOKEN"] | |
| ANNOTATION_DATA_REPO = os.environ["ANNOTATION_DATA_REPO"] | |
| ANNOTATION_DATA_REPO_BRANCH = os.environ["ANNOTATION_DATA_REPO_BRANCH"] | |
| snapshot_download(repo_id=f"{ANNOTATION_DATA_REPO}", revision=ANNOTATION_DATA_REPO_BRANCH, repo_type="dataset", local_dir="/app/potato/output", token=HF_TOKEN) | |
| print(f"downloaded existing annotations from {ANNOTATION_DATA_REPO} to /app/potato/output") | |