@@ -120,6 +120,9 @@ class OVModelForCausalLMIntegrationTest(unittest.TestCase):
120120 if is_transformers_version (">=" , "4.53.0" ):
121121 SUPPORTED_ARCHITECTURES += ("arcee" ,)
122122
123+ if is_transformers_version (">=" , "4.52.1" ) and is_openvino_version (">=" , "2025.4.0" ):
124+ SUPPORTED_ARCHITECTURES += ("bitnet" ,)
125+
123126 if is_transformers_version (">=" , "4.54.0" ):
124127 # remote code models differs after transformers v4.54
125128 SUPPORTED_ARCHITECTURES = tuple (set (SUPPORTED_ARCHITECTURES ) - {"minicpm" , "minicpm3" , "arctic" , "deepseek" })
@@ -218,11 +221,21 @@ class OVModelForCausalLMIntegrationTest(unittest.TestCase):
218221 "gpt_oss" : 2 if is_openvino_version (">=" , "2025.4" ) else 0 ,
219222 "gpt_oss_mxfp4" : 2 if is_openvino_version (">=" , "2025.4" ) else 0 ,
220223 "zamba2" : 1 ,
224+ "bitnet" : 6 ,
221225 }
222226
227+ def mock_torch_compile (self , model_arch ):
228+ if model_arch == "bitnet" :
229+ # mock torch.compile to avoid compilation errors in tests
230+ original_torch_compile = torch .compile
231+ torch .compile = lambda func : func
232+ # ensure restoration happens even if test fails
233+ self .addCleanup (lambda : setattr (torch , "compile" , original_torch_compile ))
234+
223235 # TODO: remove gptq/awq from here
224236 @parameterized .expand (SUPPORTED_ARCHITECTURES )
225237 def test_compare_to_transformers (self , model_arch ):
238+ self .mock_torch_compile (model_arch )
226239 model_id = MODEL_NAMES [model_arch ]
227240
228241 not_stateful = []
@@ -377,6 +390,7 @@ def test_compare_to_transformers(self, model_arch):
377390 @pytest .mark .run_slow
378391 @slow
379392 def test_pipeline (self , model_arch ):
393+ self .mock_torch_compile (model_arch )
380394 set_seed (SEED )
381395 model_kwargs = {}
382396 model_id = MODEL_NAMES [model_arch ]
@@ -562,6 +576,7 @@ def test_default_filling_attention_mask_and_position_ids(self):
562576 @pytest .mark .run_slow
563577 @slow
564578 def test_beam_search (self , model_arch ):
579+ self .mock_torch_compile (model_arch )
565580 model_kwargs = {}
566581 model_id = MODEL_NAMES [model_arch ]
567582 if model_arch in self .REMOTE_CODE_MODELS :
0 commit comments