support loading model without config.json file (#32356)

* support loading model without config.json file

* fix condition

* update tests

* add test

* ruff

* ruff

* ruff
This commit is contained in:
Ita Zaporozhets
2024-09-06 07:49:47 -04:00
committed by GitHub
parent e1c2b69c34
commit 363301f221
7 changed files with 27 additions and 13 deletions

View File

@@ -104,13 +104,6 @@ class AutoConfigTest(unittest.TestCase):
):
_ = AutoConfig.from_pretrained(DUMMY_UNKNOWN_IDENTIFIER, revision="aaaaaa")
def test_configuration_not_found(self):
with self.assertRaisesRegex(
EnvironmentError,
"hf-internal-testing/no-config-test-repo does not appear to have a file named config.json.",
):
_ = AutoConfig.from_pretrained("hf-internal-testing/no-config-test-repo")
def test_from_pretrained_dynamic_config(self):
# If remote code is not set, we will time out when asking whether to load the model.
with self.assertRaises(ValueError):