[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
This commit is contained in:
Younes Belkada
2023-10-02 11:35:07 +02:00
committed by GitHub
parent 24178c2461
commit 6824461f2a

View File

@@ -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")