Remove trust_remote_code=True tests from bnb quantization tests (MPT now integrated) (#38206)

bnb quant tests: remove obsolete trust_remote_code test

The MPT model is now natively integrated in Transformers and no longer requires trust_remote_code=True. This removes the failing test_get_keys_to_not_convert_trust_remote_code and related usage, which depended on remote code and caused CI issues due to missing dependencies (e.g., triton_pre_mlir).
This commit is contained in:
Titus 2025-05-20 11:43:11 +02:00 committed by GitHub
parent 0a52bd2403
commit f022bf9322
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -139,24 +139,6 @@ class MixedInt8Test(BaseMixedInt8Test):
gc.collect()
torch.cuda.empty_cache()
def test_get_keys_to_not_convert_trust_remote_code(self):
r"""
Test the `get_keys_to_not_convert` function with `trust_remote_code` models.
"""
from accelerate import init_empty_weights
from transformers.integrations.bitsandbytes import get_keys_to_not_convert
model_id = "mosaicml/mpt-7b"
config = AutoConfig.from_pretrained(
model_id, trust_remote_code=True, revision="ada218f9a93b5f1c6dce48a4cc9ff01fcba431e7"
)
with init_empty_weights():
model = AutoModelForCausalLM.from_config(
config, trust_remote_code=True, code_revision="ada218f9a93b5f1c6dce48a4cc9ff01fcba431e7"
)
self.assertEqual(get_keys_to_not_convert(model), ["transformer.wte"])
def test_get_keys_to_not_convert(self):
r"""
Test the `get_keys_to_not_convert` function.