|
7 | 7 | from tests.ut.base import TestBase |
8 | 8 | from vllm_ascend.utils import vllm_version_is |
9 | 9 |
|
| 10 | +init_cached_hf_modules_path = "vllm.utils.init_cached_hf_modules" if vllm_version_is( |
| 11 | + "0.11.0") else "vllm.utils.import_utils.init_cached_hf_modules" |
| 12 | + |
10 | 13 |
|
11 | 14 | class TestNPUWorker(TestBase): |
12 | 15 |
|
@@ -46,7 +49,7 @@ def setUp(self): |
46 | 49 | @patch("vllm_ascend.worker.worker_v1.init_ascend_config") |
47 | 50 | @patch("vllm_ascend.worker.worker_v1.init_ascend_soc_version") |
48 | 51 | @patch("vllm_ascend.worker.worker_v1.try_register_lib") |
49 | | - @patch("vllm.utils.init_cached_hf_modules") |
| 52 | + @patch(init_cached_hf_modules_path) |
50 | 53 | @patch("vllm_ascend.worker.worker_v1.NPUWorker._init_profiler") |
51 | 54 | def test_init_npu_worker_normal_case( |
52 | 55 | self, |
@@ -108,7 +111,7 @@ def test_init_npu_worker_normal_case( |
108 | 111 | @patch("vllm_ascend.worker.worker_v1.init_ascend_config") |
109 | 112 | @patch("vllm_ascend.worker.worker_v1.init_ascend_soc_version") |
110 | 113 | @patch("vllm_ascend.worker.worker_v1.try_register_lib") |
111 | | - @patch("vllm.utils.init_cached_hf_modules") |
| 114 | + @patch(init_cached_hf_modules_path) |
112 | 115 | @patch("vllm_ascend.worker.worker_v1.NPUWorker._init_profiler") |
113 | 116 | def test_init_npu_worker_with_trust_remote_code( |
114 | 117 | self, |
@@ -153,7 +156,7 @@ def test_init_npu_worker_with_trust_remote_code( |
153 | 156 | @patch("vllm_ascend.worker.worker_v1.init_ascend_config") |
154 | 157 | @patch("vllm_ascend.worker.worker_v1.init_ascend_soc_version") |
155 | 158 | @patch("vllm_ascend.worker.worker_v1.try_register_lib") |
156 | | - @patch("vllm.utils.init_cached_hf_modules") |
| 159 | + @patch(init_cached_hf_modules_path) |
157 | 160 | @patch("vllm_ascend.worker.worker_v1.NPUWorker._init_profiler") |
158 | 161 | def test_init_npu_worker_with_custom_cache_dtype( |
159 | 162 | self, |
|
0 commit comments