From f022bf93220d2c19df68647b4ddcfc5b0e91d011 Mon Sep 17 00:00:00 2001 From: Titus <9048635+Titus-von-Koeller@users.noreply.github.com> Date: Tue, 20 May 2025 11:43:11 +0200 Subject: [PATCH] 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). --- tests/quantization/bnb/test_mixed_int8.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/quantization/bnb/test_mixed_int8.py b/tests/quantization/bnb/test_mixed_int8.py index 4e954bafb3..8c718d69f4 100644 --- a/tests/quantization/bnb/test_mixed_int8.py +++ b/tests/quantization/bnb/test_mixed_int8.py @@ -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.