From 6824461f2a35546a3d781fe60576e00f6db7bedf Mon Sep 17 00:00:00 2001 From: Younes Belkada <49240599+younesbelkada@users.noreply.github.com> Date: Mon, 2 Oct 2023 11:35:07 +0200 Subject: [PATCH] [`core`/ `auto` ] Fix bnb test with code revision + bug with code revision (#26431) * fix bnb test with code revision * fix test * Apply suggestions from code review * Update src/transformers/models/auto/auto_factory.py * Update src/transformers/models/auto/auto_factory.py * Update src/transformers/models/auto/auto_factory.py --- tests/quantization/bnb/test_mixed_int8.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/quantization/bnb/test_mixed_int8.py b/tests/quantization/bnb/test_mixed_int8.py index 3f3a25913e..4ff3a32b33 100644 --- a/tests/quantization/bnb/test_mixed_int8.py +++ b/tests/quantization/bnb/test_mixed_int8.py @@ -138,7 +138,9 @@ class MixedInt8Test(BaseMixedInt8Test): model_id, trust_remote_code=True, revision="72e5f594ce36f9cabfa2a9fd8f58b491eb467ee7" ) with init_empty_weights(): - model = AutoModelForCausalLM.from_config(config, trust_remote_code=True) + model = AutoModelForCausalLM.from_config( + config, trust_remote_code=True, code_revision="72e5f594ce36f9cabfa2a9fd8f58b491eb467ee7" + ) self.assertEqual(get_keys_to_not_convert(model), ["transformer.wte"]) # without trust_remote_code config = AutoConfig.from_pretrained(model_id, revision="72e5f594ce36f9cabfa2a9fd8f58b491eb467ee7")