Download evaluation/scripts/download_data.py from EllaNAM/rag-assignment-processed-bm25: direct link, hf CLI and curl.
- Browser
- Download file 938 Bytes
-
https://huggingface.co/datasets/EllaNAM/rag-assignment-processed-bm25/resolve/main/evaluation/scripts/download_data.py
- Command line
-
hf download hf://datasets/EllaNAM/rag-assignment-processed-bm25/evaluation/scripts/download_data.py
-
curl -L -o download_data.py https://huggingface.co/datasets/EllaNAM/rag-assignment-processed-bm25/resolve/main/evaluation/scripts/download_data.py
938 Bytes
| #!/usr/bin/env python3 | |
| """Download the assignment JSONL and optionally the official BM25 index.""" | |
| from __future__ import annotations | |
| import argparse | |
| from pathlib import Path | |
| from huggingface_hub import snapshot_download | |
| def main() -> None: | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("--repo", default="NLPlab-skku/RAG-assignment") | |
| parser.add_argument("--revision", help="Pin a commit hash for the final experiment") | |
| parser.add_argument("--output", type=Path, default=Path("data")) | |
| parser.add_argument("--with-baseline-index", action="store_true") | |
| args = parser.parse_args() | |
| path = snapshot_download( | |
| repo_id=args.repo, | |
| repo_type="dataset", | |
| revision=args.revision, | |
| local_dir=args.output, | |
| allow_patterns=["*.jsonl", "**/*.jsonl"] + (["index/lexical/*"] if args.with_baseline_index else []), | |
| ) | |
| print(path) | |
| if __name__ == "__main__": | |
| main() | |