diff --git a/tests/utils/test_modeling_utils.py b/tests/utils/test_modeling_utils.py index cb6111722a33..ec6d8745cfd0 100644 --- a/tests/utils/test_modeling_utils.py +++ b/tests/utils/test_modeling_utils.py @@ -1319,12 +1319,6 @@ def test_use_safetensors(self): with self.assertRaises(OSError) as missing_model_file_error: BertModel.from_pretrained("hf-internal-testing/config-no-model") - self.assertTrue( - "does not appear to have a file named pytorch_model.bin or model.safetensors." - in str(missing_model_file_error.exception), - msg=missing_model_file_error.exception, - ) - with self.assertRaises(OSError) as missing_model_file_error: with tempfile.TemporaryDirectory() as tmp_dir: with open(os.path.join(tmp_dir, "config.json"), "w") as f: