Final_Assignment_Template / try_download.py
InfinityCoder5607
update
c40eaa2
Raw
History Blame Contribute Delete
658 Bytes
from datasets import load_dataset
from huggingface_hub import hf_hub_download
task_id = "cca530fc-4052-43b2-b130-b30968d8aa44"
dataset = load_dataset(
"gaia-benchmark/GAIA",
"2023_level1",
split="validation",
trust_remote_code=True,
)
for item in dataset:
if item["task_id"] == task_id:
print("file_name:", item["file_name"])
print("file_path:", item["file_path"])
file_path = hf_hub_download(
repo_id="gaia-benchmark/GAIA",
repo_type="dataset",
filename=item["file_path"],
local_dir="attachments",
)
print("下载到:", file_path)
break