@@ -25,7 +25,7 @@ def test_get_gemma_chat_model_with_peft():
2525 "device" : "cpu" ,
2626 "peft_model_path" : "path/to/peft/model" ,
2727 }
28- with patch (
28+ with patch ("sys.platform" , "linux" ), patch (
2929 "readme_ready.utils.llm_utils.hf_hub_download"
3030 ) as mock_hf_download , patch (
3131 "readme_ready.utils.llm_utils.get_tokenizer"
@@ -69,6 +69,7 @@ def test_get_gemma_chat_model_with_peft():
6969 gguf_file = model_kwargs ["gguf_file" ],
7070 trust_remote_code = True ,
7171 device_map = model_kwargs ["device" ],
72+ quantization_config = mock .ANY ,
7273 token = "test_token" ,
7374 )
7475 mock_peft_model .assert_called_once_with (
@@ -87,7 +88,7 @@ def test_get_gemma_chat_model_without_peft():
8788 "gguf_file" : "some_file.gguf" ,
8889 "device" : "cpu" ,
8990 }
90- with patch (
91+ with patch ("sys.platform" , "linux" ), patch (
9192 "readme_ready.utils.llm_utils.hf_hub_download"
9293 ) as mock_hf_download , patch (
9394 "readme_ready.utils.llm_utils.get_tokenizer"
@@ -128,6 +129,7 @@ def test_get_gemma_chat_model_without_peft():
128129 gguf_file = model_kwargs ["gguf_file" ],
129130 trust_remote_code = True ,
130131 device_map = model_kwargs ["device" ],
132+ quantization_config = mock .ANY ,
131133 token = "test_token" ,
132134 )
133135 mock_peft_model .assert_not_called ()
@@ -205,7 +207,7 @@ def test_get_llama_chat_model_with_peft():
205207 "device" : "cpu" ,
206208 "peft_model" : "path/to/peft/model" ,
207209 }
208- with patch (
210+ with patch ("sys.platform" , "linux" ), patch (
209211 "readme_ready.utils.llm_utils.hf_hub_download"
210212 ) as mock_hf_download , patch (
211213 "readme_ready.utils.llm_utils.get_tokenizer"
@@ -252,6 +254,7 @@ def test_get_llama_chat_model_with_peft():
252254 gguf_file = model_kwargs ["gguf_file" ],
253255 trust_remote_code = True ,
254256 device_map = model_kwargs ["device" ],
257+ quantization_config = mock .ANY ,
255258 token = "test_token" ,
256259 )
257260 mock_peft_model .assert_called_once_with (
@@ -270,7 +273,7 @@ def test_get_llama_chat_model_without_peft():
270273 "gguf_file" : "some_file.gguf" ,
271274 "device" : "cpu" ,
272275 }
273- with patch (
276+ with patch ("sys.platform" , "linux" ), patch (
274277 "readme_ready.utils.llm_utils.hf_hub_download"
275278 ) as mock_hf_download , patch (
276279 "readme_ready.utils.llm_utils.get_tokenizer"
@@ -314,6 +317,7 @@ def test_get_llama_chat_model_without_peft():
314317 gguf_file = model_kwargs ["gguf_file" ],
315318 trust_remote_code = True ,
316319 device_map = model_kwargs ["device" ],
320+ quantization_config = mock .ANY ,
317321 token = "test_token" ,
318322 )
319323 mock_peft_model .assert_not_called ()
0 commit comments