From 67b4762cd4067842554ce9b21172470559c0560f Mon Sep 17 00:00:00 2001 From: ahmadmustafaanis Date: Sat, 19 Oct 2024 10:39:10 +0000 Subject: [PATCH] Add: login to hf --- src/download_and_filter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/download_and_filter.py b/src/download_and_filter.py index dfedee47..d99b1e87 100644 --- a/src/download_and_filter.py +++ b/src/download_and_filter.py @@ -13,14 +13,15 @@ from downloader import Downloader import data_bibtex as data_bibtex from dotenv import load_dotenv -from huggingface_hub import HfApi, utils -from datasets.exceptions import DatasetNotFoundError +from huggingface_hub import HfApi, utils, login +# from datasets.exceptions import DatasetNotFoundError load_dotenv() hf_token = os.getenv('HF_TOKEN') try: api = HfApi(token=hf_token) + login(hf_token, add_to_git_credential=True) print("Hugging Face Authorization Successful!") except Exception as e: print(e)