File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -267,7 +267,11 @@ def test_detect_accelerator_cpu_when_no_gpu_layers(self):
267267 def test_detect_accelerator_non_cpu_when_gpu_layers_offloaded (self ):
268268 llm = Llama ()
269269 llm .n_gpu_layers = 32
270- assert gguf_detect_accelerator (llm ) != "cpu"
270+ with patch (
271+ "wildedge.integrations.gguf.CURRENT_PLATFORM.gpu_accelerator_for_offload" ,
272+ return_value = "cuda" ,
273+ ):
274+ assert gguf_detect_accelerator (llm ) == "cuda"
271275
272276 def test_extract_info_uses_filename_stem_as_model_id (self ):
273277 model_id , info = self .extractor .extract_info (Llama (), {})
@@ -403,7 +407,11 @@ def test_extract_info_override_model_id(self):
403407 def test_detect_accelerator_gpu_from_weight_device (self ):
404408 model = _FakeKerasModel ()
405409 model .weights = [MagicMock (device = "/GPU:0" )]
406- assert keras_detect_accelerator (model ) != "cpu"
410+ with patch (
411+ "wildedge.integrations.keras.CURRENT_PLATFORM.gpu_accelerator_for_offload" ,
412+ return_value = "cuda" ,
413+ ):
414+ assert keras_detect_accelerator (model ) == "cuda"
407415
408416 def test_install_hooks_publishes_inference_on_call (self , publish_spy ):
409417 model = _FakeKerasModel ()
You can’t perform that action at this time.
0 commit comments