|
8 | 8 | from tests.ut.base import TestBase |
9 | 9 | from vllm_ascend.utils import vllm_version_is |
10 | 10 |
|
| 11 | +init_cached_hf_modules_path = "vllm.utils.init_cached_hf_modules" if vllm_version_is( |
| 12 | + "0.11.0") else "vllm.utils.import_utils.init_cached_hf_modules" |
| 13 | + |
11 | 14 |
|
12 | 15 | class TestNPUWorker(TestBase): |
13 | 16 |
|
@@ -53,7 +56,7 @@ def setUp(self): |
53 | 56 | @patch("vllm_ascend.worker.worker_v1.init_ascend_config") |
54 | 57 | @patch("vllm_ascend.worker.worker_v1.init_ascend_soc_version") |
55 | 58 | @patch("vllm_ascend.worker.worker_v1.try_register_lib") |
56 | | - @patch("vllm.utils.init_cached_hf_modules") |
| 59 | + @patch(init_cached_hf_modules_path) |
57 | 60 | @patch("vllm_ascend.worker.worker_v1.NPUWorker._init_profiler") |
58 | 61 | def test_init_npu_worker_normal_case( |
59 | 62 | self, |
@@ -115,7 +118,7 @@ def test_init_npu_worker_normal_case( |
115 | 118 | @patch("vllm_ascend.worker.worker_v1.init_ascend_config") |
116 | 119 | @patch("vllm_ascend.worker.worker_v1.init_ascend_soc_version") |
117 | 120 | @patch("vllm_ascend.worker.worker_v1.try_register_lib") |
118 | | - @patch("vllm.utils.init_cached_hf_modules") |
| 121 | + @patch(init_cached_hf_modules_path) |
119 | 122 | @patch("vllm_ascend.worker.worker_v1.NPUWorker._init_profiler") |
120 | 123 | def test_init_npu_worker_with_trust_remote_code( |
121 | 124 | self, |
@@ -160,7 +163,7 @@ def test_init_npu_worker_with_trust_remote_code( |
160 | 163 | @patch("vllm_ascend.worker.worker_v1.init_ascend_config") |
161 | 164 | @patch("vllm_ascend.worker.worker_v1.init_ascend_soc_version") |
162 | 165 | @patch("vllm_ascend.worker.worker_v1.try_register_lib") |
163 | | - @patch("vllm.utils.init_cached_hf_modules") |
| 166 | + @patch(init_cached_hf_modules_path) |
164 | 167 | @patch("vllm_ascend.worker.worker_v1.NPUWorker._init_profiler") |
165 | 168 | def test_init_npu_worker_with_custom_cache_dtype( |
166 | 169 | self, |
|
0 commit comments