EllaNAM's picture
Add editable evaluation notebooks and their Python source
46e547f verified
Raw History Blame Contribute Delete
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()