Skip to content

Commit

Permalink
Update fetch_data.py
Browse files Browse the repository at this point in the history
Used tqdm to track progress of fetching the datasets so it is more interactive by including a progress bar david4096#24
  • Loading branch information
Edwin-Ong-Jun-Kiat authored Nov 7, 2024
1 parent 3c1a44d commit 13e9d41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion huggingface_rdf/fetch_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import requests
import os
from huggingface_hub import HfApi, list_datasets
from tqdm import tqdm

headers = {"Authorization": f"Bearer {os.environ['HF_API_KEY']}"}
API_URL = "https://huggingface.co/api/datasets/"
Expand All @@ -14,4 +15,4 @@ def get_datasets(limit):

def fetch_datasets(limit):
datasets = get_datasets(limit)
return [croissant_dataset(dataset.id) for dataset in datasets]
return [croissant_dataset(dataset.id) for dataset in tqdm(datasets, desc="Fetching datasets")]

0 comments on commit 13e9d41

Please sign in to comment.