From 4ed9ae623d16876ad84ea89dfdf1c9378e36961b Mon Sep 17 00:00:00 2001 From: amyeroberts <22614925+amyeroberts@users.noreply.github.com> Date: Thu, 7 Mar 2024 17:30:28 +0000 Subject: [PATCH] test_generation_config_is_loaded_with_model - fall back to pytorch model for now (#29521) * Fall back to pytorch model for now * Fix up --- tests/test_modeling_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_modeling_utils.py b/tests/test_modeling_utils.py index 1f277c7504..d0db5031e8 100755 --- a/tests/test_modeling_utils.py +++ b/tests/test_modeling_utils.py @@ -1188,12 +1188,14 @@ class ModelUtilsTest(TestCasePlus): # `transformers_version` field set to `foo`. If loading the file fails, this test also fails. # 1. Load without further parameters - model = AutoModelForCausalLM.from_pretrained("joaogante/tiny-random-gpt2-with-generation-config") + model = AutoModelForCausalLM.from_pretrained( + "joaogante/tiny-random-gpt2-with-generation-config", use_safetensors=False + ) self.assertEqual(model.generation_config.transformers_version, "foo") # 2. Load with `device_map` model = AutoModelForCausalLM.from_pretrained( - "joaogante/tiny-random-gpt2-with-generation-config", device_map="auto" + "joaogante/tiny-random-gpt2-with-generation-config", device_map="auto", use_safetensors=False ) self.assertEqual(model.generation_config.transformers_version, "foo")