Remove set_access_token usage + fail tests if FutureWarning (#22051)
* Remove set_access_token usage + fail tests if FutureWarning * do not fail on FutureWarning in CI --------- Co-authored-by: testbot <lucainp@hf.co>
This commit is contained in:
@@ -17,7 +17,7 @@ import copy
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from huggingface_hub import HfFolder, delete_repo, set_access_token
|
||||
from huggingface_hub import HfFolder, delete_repo
|
||||
from parameterized import parameterized
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
@@ -99,7 +99,6 @@ class ConfigPushToHubTester(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls._token = TOKEN
|
||||
set_access_token(TOKEN)
|
||||
HfFolder.save_token(TOKEN)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -21,7 +21,7 @@ import unittest
|
||||
from pathlib import Path
|
||||
from shutil import copyfile
|
||||
|
||||
from huggingface_hub import HfFolder, Repository, create_repo, delete_repo, set_access_token
|
||||
from huggingface_hub import HfFolder, Repository, create_repo, delete_repo
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
from transformers import (
|
||||
@@ -219,7 +219,6 @@ class ProcessorPushToHubTester(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls._token = TOKEN
|
||||
set_access_token(TOKEN)
|
||||
HfFolder.save_token(TOKEN)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -21,7 +21,7 @@ from pathlib import Path
|
||||
|
||||
import datasets
|
||||
import numpy as np
|
||||
from huggingface_hub import HfFolder, Repository, create_repo, delete_repo, set_access_token
|
||||
from huggingface_hub import HfFolder, Repository, create_repo, delete_repo
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
from transformers import (
|
||||
@@ -759,7 +759,6 @@ class DynamicPipelineTester(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls._token = TOKEN
|
||||
set_access_token(TOKEN)
|
||||
HfFolder.save_token(TOKEN)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -23,7 +23,7 @@ import unittest
|
||||
import unittest.mock as mock
|
||||
from pathlib import Path
|
||||
|
||||
from huggingface_hub import HfFolder, delete_repo, set_access_token
|
||||
from huggingface_hub import HfFolder, delete_repo
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
from transformers import AutoConfig, BertConfig, GPT2Config, is_torch_available
|
||||
@@ -222,7 +222,6 @@ class ConfigPushToHubTester(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls._token = TOKEN
|
||||
set_access_token(TOKEN)
|
||||
HfFolder.save_token(TOKEN)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -22,7 +22,7 @@ import unittest
|
||||
import unittest.mock as mock
|
||||
from pathlib import Path
|
||||
|
||||
from huggingface_hub import HfFolder, delete_repo, set_access_token
|
||||
from huggingface_hub import HfFolder, delete_repo
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
from transformers import AutoFeatureExtractor, Wav2Vec2FeatureExtractor
|
||||
@@ -100,7 +100,6 @@ class FeatureExtractorPushToHubTester(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls._token = TOKEN
|
||||
set_access_token(TOKEN)
|
||||
HfFolder.save_token(TOKEN)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -22,7 +22,7 @@ import unittest
|
||||
import unittest.mock as mock
|
||||
from pathlib import Path
|
||||
|
||||
from huggingface_hub import HfFolder, delete_repo, set_access_token
|
||||
from huggingface_hub import HfFolder, delete_repo
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
from transformers import AutoImageProcessor, ViTImageProcessor
|
||||
@@ -232,7 +232,6 @@ class ImageProcessorPushToHubTester(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls._token = TOKEN
|
||||
set_access_token(TOKEN)
|
||||
HfFolder.save_token(TOKEN)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -30,7 +30,7 @@ from pathlib import Path
|
||||
from typing import Dict, List, Tuple
|
||||
|
||||
import numpy as np
|
||||
from huggingface_hub import HfFolder, delete_repo, set_access_token
|
||||
from huggingface_hub import HfFolder, delete_repo
|
||||
from huggingface_hub.file_download import http_get
|
||||
from pytest import mark
|
||||
from requests.exceptions import HTTPError
|
||||
@@ -3429,7 +3429,6 @@ class ModelPushToHubTester(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls._token = TOKEN
|
||||
set_access_token(TOKEN)
|
||||
HfFolder.save_token(TOKEN)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -21,7 +21,7 @@ import unittest
|
||||
from typing import List, Tuple
|
||||
|
||||
import numpy as np
|
||||
from huggingface_hub import HfFolder, delete_repo, set_access_token
|
||||
from huggingface_hub import HfFolder, delete_repo
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
import transformers
|
||||
@@ -1173,7 +1173,6 @@ class FlaxModelPushToHubTester(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls._token = TOKEN
|
||||
set_access_token(TOKEN)
|
||||
HfFolder.save_token(TOKEN)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -28,7 +28,7 @@ from math import isnan
|
||||
from typing import List, Tuple, get_type_hints
|
||||
|
||||
from datasets import Dataset
|
||||
from huggingface_hub import HfFolder, Repository, delete_repo, set_access_token
|
||||
from huggingface_hub import HfFolder, Repository, delete_repo
|
||||
from huggingface_hub.file_download import http_get
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
@@ -2409,7 +2409,6 @@ class TFModelPushToHubTester(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls._token = TOKEN
|
||||
set_access_token(TOKEN)
|
||||
HfFolder.save_token(TOKEN)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -30,7 +30,7 @@ from itertools import takewhile
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, Tuple, Union
|
||||
|
||||
from huggingface_hub import HfFolder, delete_repo, set_access_token
|
||||
from huggingface_hub import HfFolder, delete_repo
|
||||
from huggingface_hub.file_download import http_get
|
||||
from parameterized import parameterized
|
||||
from requests.exceptions import HTTPError
|
||||
@@ -3971,7 +3971,6 @@ class TokenizerPushToHubTester(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls._token = TOKEN
|
||||
set_access_token(TOKEN)
|
||||
HfFolder.save_token(TOKEN)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -29,7 +29,7 @@ from pathlib import Path
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import numpy as np
|
||||
from huggingface_hub import HfFolder, Repository, delete_repo, set_access_token
|
||||
from huggingface_hub import HfFolder, Repository, delete_repo
|
||||
from parameterized import parameterized
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
@@ -2005,7 +2005,6 @@ class TrainerIntegrationWithHubTester(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls._token = TOKEN
|
||||
set_access_token(TOKEN)
|
||||
HfFolder.save_token(TOKEN)
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user