Skip to content

Commit

Permalink
test_generation_config_is_loaded_with_model - fall back to pytorch mo…
Browse files Browse the repository at this point in the history
…del for now (#29521)

* Fall back to pytorch model for now

* Fix up
  • Loading branch information
amyeroberts committed Mar 7, 2024
1 parent 45c0651 commit 4ed9ae6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1188,12 +1188,14 @@ def test_generation_config_is_loaded_with_model(self):
# `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")

Expand Down

0 comments on commit 4ed9ae6

Please sign in to comment.