diff --git a/policyengine_core/data/dataset.py b/policyengine_core/data/dataset.py index 9f3b1848..d648417e 100644 --- a/policyengine_core/data/dataset.py +++ b/policyengine_core/data/dataset.py @@ -461,7 +461,6 @@ def upload_to_huggingface(self, owner_name: str, model_name: str): token = os.environ.get( "HUGGING_FACE_TOKEN", ) - login(token=token) api = HfApi() api.upload_file( @@ -469,6 +468,7 @@ def upload_to_huggingface(self, owner_name: str, model_name: str): path_in_repo=self.file_path.name, repo_id=f"{owner_name}/{model_name}", repo_type="model", + token=token, ) def download_from_huggingface( @@ -483,11 +483,11 @@ def download_from_huggingface( token = os.environ.get( "HUGGING_FACE_TOKEN", ) - login(token=token) hf_hub_download( repo_id=f"{owner_name}/{model_name}", repo_type="model", path=self.file_path, revision=version, + token=token, )