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 tempfile
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from huggingface_hub import HfFolder, delete_repo, set_access_token
|
from huggingface_hub import HfFolder, delete_repo
|
||||||
from parameterized import parameterized
|
from parameterized import parameterized
|
||||||
from requests.exceptions import HTTPError
|
from requests.exceptions import HTTPError
|
||||||
|
|
||||||
@@ -99,7 +99,6 @@ class ConfigPushToHubTester(unittest.TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls._token = TOKEN
|
cls._token = TOKEN
|
||||||
set_access_token(TOKEN)
|
|
||||||
HfFolder.save_token(TOKEN)
|
HfFolder.save_token(TOKEN)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import unittest
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from shutil import copyfile
|
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 requests.exceptions import HTTPError
|
||||||
|
|
||||||
from transformers import (
|
from transformers import (
|
||||||
@@ -219,7 +219,6 @@ class ProcessorPushToHubTester(unittest.TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls._token = TOKEN
|
cls._token = TOKEN
|
||||||
set_access_token(TOKEN)
|
|
||||||
HfFolder.save_token(TOKEN)
|
HfFolder.save_token(TOKEN)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
import datasets
|
import datasets
|
||||||
import numpy as np
|
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 requests.exceptions import HTTPError
|
||||||
|
|
||||||
from transformers import (
|
from transformers import (
|
||||||
@@ -759,7 +759,6 @@ class DynamicPipelineTester(unittest.TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls._token = TOKEN
|
cls._token = TOKEN
|
||||||
set_access_token(TOKEN)
|
|
||||||
HfFolder.save_token(TOKEN)
|
HfFolder.save_token(TOKEN)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import unittest
|
|||||||
import unittest.mock as mock
|
import unittest.mock as mock
|
||||||
from pathlib import Path
|
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 requests.exceptions import HTTPError
|
||||||
|
|
||||||
from transformers import AutoConfig, BertConfig, GPT2Config, is_torch_available
|
from transformers import AutoConfig, BertConfig, GPT2Config, is_torch_available
|
||||||
@@ -222,7 +222,6 @@ class ConfigPushToHubTester(unittest.TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls._token = TOKEN
|
cls._token = TOKEN
|
||||||
set_access_token(TOKEN)
|
|
||||||
HfFolder.save_token(TOKEN)
|
HfFolder.save_token(TOKEN)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import unittest
|
|||||||
import unittest.mock as mock
|
import unittest.mock as mock
|
||||||
from pathlib import Path
|
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 requests.exceptions import HTTPError
|
||||||
|
|
||||||
from transformers import AutoFeatureExtractor, Wav2Vec2FeatureExtractor
|
from transformers import AutoFeatureExtractor, Wav2Vec2FeatureExtractor
|
||||||
@@ -100,7 +100,6 @@ class FeatureExtractorPushToHubTester(unittest.TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls._token = TOKEN
|
cls._token = TOKEN
|
||||||
set_access_token(TOKEN)
|
|
||||||
HfFolder.save_token(TOKEN)
|
HfFolder.save_token(TOKEN)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import unittest
|
|||||||
import unittest.mock as mock
|
import unittest.mock as mock
|
||||||
from pathlib import Path
|
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 requests.exceptions import HTTPError
|
||||||
|
|
||||||
from transformers import AutoImageProcessor, ViTImageProcessor
|
from transformers import AutoImageProcessor, ViTImageProcessor
|
||||||
@@ -232,7 +232,6 @@ class ImageProcessorPushToHubTester(unittest.TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls._token = TOKEN
|
cls._token = TOKEN
|
||||||
set_access_token(TOKEN)
|
|
||||||
HfFolder.save_token(TOKEN)
|
HfFolder.save_token(TOKEN)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ from pathlib import Path
|
|||||||
from typing import Dict, List, Tuple
|
from typing import Dict, List, Tuple
|
||||||
|
|
||||||
import numpy as np
|
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 huggingface_hub.file_download import http_get
|
||||||
from pytest import mark
|
from pytest import mark
|
||||||
from requests.exceptions import HTTPError
|
from requests.exceptions import HTTPError
|
||||||
@@ -3429,7 +3429,6 @@ class ModelPushToHubTester(unittest.TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls._token = TOKEN
|
cls._token = TOKEN
|
||||||
set_access_token(TOKEN)
|
|
||||||
HfFolder.save_token(TOKEN)
|
HfFolder.save_token(TOKEN)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import unittest
|
|||||||
from typing import List, Tuple
|
from typing import List, Tuple
|
||||||
|
|
||||||
import numpy as np
|
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
|
from requests.exceptions import HTTPError
|
||||||
|
|
||||||
import transformers
|
import transformers
|
||||||
@@ -1173,7 +1173,6 @@ class FlaxModelPushToHubTester(unittest.TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls._token = TOKEN
|
cls._token = TOKEN
|
||||||
set_access_token(TOKEN)
|
|
||||||
HfFolder.save_token(TOKEN)
|
HfFolder.save_token(TOKEN)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ from math import isnan
|
|||||||
from typing import List, Tuple, get_type_hints
|
from typing import List, Tuple, get_type_hints
|
||||||
|
|
||||||
from datasets import Dataset
|
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 huggingface_hub.file_download import http_get
|
||||||
from requests.exceptions import HTTPError
|
from requests.exceptions import HTTPError
|
||||||
|
|
||||||
@@ -2409,7 +2409,6 @@ class TFModelPushToHubTester(unittest.TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls._token = TOKEN
|
cls._token = TOKEN
|
||||||
set_access_token(TOKEN)
|
|
||||||
HfFolder.save_token(TOKEN)
|
HfFolder.save_token(TOKEN)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ from itertools import takewhile
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, Any, Dict, List, Tuple, Union
|
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 huggingface_hub.file_download import http_get
|
||||||
from parameterized import parameterized
|
from parameterized import parameterized
|
||||||
from requests.exceptions import HTTPError
|
from requests.exceptions import HTTPError
|
||||||
@@ -3971,7 +3971,6 @@ class TokenizerPushToHubTester(unittest.TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls._token = TOKEN
|
cls._token = TOKEN
|
||||||
set_access_token(TOKEN)
|
|
||||||
HfFolder.save_token(TOKEN)
|
HfFolder.save_token(TOKEN)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ from pathlib import Path
|
|||||||
from unittest.mock import Mock, patch
|
from unittest.mock import Mock, patch
|
||||||
|
|
||||||
import numpy as np
|
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 parameterized import parameterized
|
||||||
from requests.exceptions import HTTPError
|
from requests.exceptions import HTTPError
|
||||||
|
|
||||||
@@ -2005,7 +2005,6 @@ class TrainerIntegrationWithHubTester(unittest.TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls._token = TOKEN
|
cls._token = TOKEN
|
||||||
set_access_token(TOKEN)
|
|
||||||
HfFolder.save_token(TOKEN)
|
HfFolder.save_token(TOKEN)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user