|
25 | 25 | import unittest.mock as mock |
26 | 26 |
|
27 | 27 | from huggingface_hub import HfFolder, Repository, delete_repo, snapshot_download |
28 | | -from huggingface_hub.file_download import http_get |
29 | 28 | from requests.exceptions import HTTPError |
30 | 29 |
|
31 | 30 | from transformers import is_tf_available, is_torch_available |
@@ -106,24 +105,6 @@ def test_cached_files_are_used_when_internet_is_down(self): |
106 | 105 | # This check we did call the fake head request |
107 | 106 | mock_head.assert_called() |
108 | 107 |
|
109 | | - def test_load_from_one_file(self): |
110 | | - try: |
111 | | - tmp_file = tempfile.mktemp() |
112 | | - with open(tmp_file, "wb") as f: |
113 | | - http_get("https://huggingface.co/hf-internal-testing/tiny-random-bert/resolve/main/tf_model.h5", f) |
114 | | - |
115 | | - config = BertConfig.from_pretrained("hf-internal-testing/tiny-random-bert") |
116 | | - _ = TFBertModel.from_pretrained(tmp_file, config=config) |
117 | | - finally: |
118 | | - os.remove(tmp_file) |
119 | | - |
120 | | - def test_legacy_load_from_url(self): |
121 | | - # This test is for deprecated behavior and can be removed in v5 |
122 | | - config = BertConfig.from_pretrained("hf-internal-testing/tiny-random-bert") |
123 | | - _ = TFBertModel.from_pretrained( |
124 | | - "https://huggingface.co/hf-internal-testing/tiny-random-bert/resolve/main/tf_model.h5", config=config |
125 | | - ) |
126 | | - |
127 | 108 | # tests whether the unpack_inputs function behaves as expected |
128 | 109 | def test_unpack_inputs(self): |
129 | 110 | class DummyModel: |
|
0 commit comments