Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
169b8cde
Unverified
Commit
169b8cde
authored
Aug 29, 2022
by
Lucain
Committed by
GitHub
Aug 29, 2022
Browse files
Fix mock in `test_cached_files_are_used_when_internet_is_down` (#18804)
parent
8b67f209
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
0 deletions
+5
-0
tests/test_configuration_common.py
tests/test_configuration_common.py
+1
-0
tests/test_feature_extraction_common.py
tests/test_feature_extraction_common.py
+1
-0
tests/test_modeling_common.py
tests/test_modeling_common.py
+1
-0
tests/test_modeling_tf_common.py
tests/test_modeling_tf_common.py
+1
-0
tests/test_tokenization_common.py
tests/test_tokenization_common.py
+1
-0
No files found.
tests/test_configuration_common.py
View file @
169b8cde
...
@@ -349,6 +349,7 @@ class ConfigTestUtils(unittest.TestCase):
...
@@ -349,6 +349,7 @@ class ConfigTestUtils(unittest.TestCase):
response_mock
.
status_code
=
500
response_mock
.
status_code
=
500
response_mock
.
headers
=
{}
response_mock
.
headers
=
{}
response_mock
.
raise_for_status
.
side_effect
=
HTTPError
response_mock
.
raise_for_status
.
side_effect
=
HTTPError
response_mock
.
json
.
return_value
=
{}
# Download this model to make sure it's in the cache.
# Download this model to make sure it's in the cache.
_
=
BertConfig
.
from_pretrained
(
"hf-internal-testing/tiny-random-bert"
)
_
=
BertConfig
.
from_pretrained
(
"hf-internal-testing/tiny-random-bert"
)
...
...
tests/test_feature_extraction_common.py
View file @
169b8cde
...
@@ -172,6 +172,7 @@ class FeatureExtractorUtilTester(unittest.TestCase):
...
@@ -172,6 +172,7 @@ class FeatureExtractorUtilTester(unittest.TestCase):
response_mock
.
status_code
=
500
response_mock
.
status_code
=
500
response_mock
.
headers
=
{}
response_mock
.
headers
=
{}
response_mock
.
raise_for_status
.
side_effect
=
HTTPError
response_mock
.
raise_for_status
.
side_effect
=
HTTPError
response_mock
.
json
.
return_value
=
{}
# Download this model to make sure it's in the cache.
# Download this model to make sure it's in the cache.
_
=
Wav2Vec2FeatureExtractor
.
from_pretrained
(
"hf-internal-testing/tiny-random-wav2vec2"
)
_
=
Wav2Vec2FeatureExtractor
.
from_pretrained
(
"hf-internal-testing/tiny-random-wav2vec2"
)
...
...
tests/test_modeling_common.py
View file @
169b8cde
...
@@ -2931,6 +2931,7 @@ class ModelUtilsTest(TestCasePlus):
...
@@ -2931,6 +2931,7 @@ class ModelUtilsTest(TestCasePlus):
response_mock
.
status_code
=
500
response_mock
.
status_code
=
500
response_mock
.
headers
=
{}
response_mock
.
headers
=
{}
response_mock
.
raise_for_status
.
side_effect
=
HTTPError
response_mock
.
raise_for_status
.
side_effect
=
HTTPError
response_mock
.
json
.
return_value
=
{}
# Download this model to make sure it's in the cache.
# Download this model to make sure it's in the cache.
_
=
BertModel
.
from_pretrained
(
"hf-internal-testing/tiny-random-bert"
)
_
=
BertModel
.
from_pretrained
(
"hf-internal-testing/tiny-random-bert"
)
...
...
tests/test_modeling_tf_common.py
View file @
169b8cde
...
@@ -1924,6 +1924,7 @@ class UtilsFunctionsTest(unittest.TestCase):
...
@@ -1924,6 +1924,7 @@ class UtilsFunctionsTest(unittest.TestCase):
response_mock
.
status_code
=
500
response_mock
.
status_code
=
500
response_mock
.
headers
=
{}
response_mock
.
headers
=
{}
response_mock
.
raise_for_status
.
side_effect
=
HTTPError
response_mock
.
raise_for_status
.
side_effect
=
HTTPError
response_mock
.
json
.
return_value
=
{}
# Download this model to make sure it's in the cache.
# Download this model to make sure it's in the cache.
_
=
TFBertModel
.
from_pretrained
(
"hf-internal-testing/tiny-random-bert"
)
_
=
TFBertModel
.
from_pretrained
(
"hf-internal-testing/tiny-random-bert"
)
...
...
tests/test_tokenization_common.py
View file @
169b8cde
...
@@ -3875,6 +3875,7 @@ class TokenizerUtilTester(unittest.TestCase):
...
@@ -3875,6 +3875,7 @@ class TokenizerUtilTester(unittest.TestCase):
response_mock
.
status_code
=
500
response_mock
.
status_code
=
500
response_mock
.
headers
=
{}
response_mock
.
headers
=
{}
response_mock
.
raise_for_status
.
side_effect
=
HTTPError
response_mock
.
raise_for_status
.
side_effect
=
HTTPError
response_mock
.
json
.
return_value
=
{}
# Download this model to make sure it's in the cache.
# Download this model to make sure it's in the cache.
_
=
BertTokenizer
.
from_pretrained
(
"hf-internal-testing/tiny-random-bert"
)
_
=
BertTokenizer
.
from_pretrained
(
"hf-internal-testing/tiny-random-bert"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment