A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 17:15 UTC
[Bugfix] LoRA V1: add and fix entrypoints tests (#15715)
Signed-off-by: Varun Sundar Rabindranath <varun@neuralmagic.com> Co-authored-by: Varun Sundar Rabindranath <varun@neuralmagic.com>
Varun Sundar Rabindranath committed
Mar 28, 2025 at 21:10 UTC
1286211f573586719d80e96ce1e618b620e61f56
3 files changed
+28
-3
tests/entrypoints/llm/test_generate_multiple_loras.py
+13
-1
@@ -23,7 +23,19 @@ LORA_NAME = "typeof/zephyr-7b-beta-lora"
23
24
25
@pytest.fixture(scope="module")
26
-def llm():
26
+def monkeypatch_module():
27
+ from _pytest.monkeypatch import MonkeyPatch
28
+ mpatch = MonkeyPatch()
29
+ yield mpatch
30
+ mpatch.undo()
31
+
32
+
33
+@pytest.fixture(scope="module", params=[False, True])
34
+def llm(request, monkeypatch_module):
35
+
36
+ use_v1 = request.param
37
+ monkeypatch_module.setenv('VLLM_USE_V1', '1' if use_v1 else '0')
38
+
39
# pytest caches the fixture so we use weakref.proxy to
40
# enable garbage collection
41
llm = LLM(model=MODEL_NAME,
tests/entrypoints/openai/test_lora_adapters.py
+14
-1
@@ -53,7 +53,20 @@ def zephyr_lora_files():
53
54
55
@pytest.fixture(scope="module")
56
-def server_with_lora_modules_json(zephyr_lora_files):
56
+def monkeypatch_module():
57
+ from _pytest.monkeypatch import MonkeyPatch
58
+ mpatch = MonkeyPatch()
59
+ yield mpatch
60
+ mpatch.undo()
61
+
62
+
63
+@pytest.fixture(scope="module", params=[False, True])
64
+def server_with_lora_modules_json(request, monkeypatch_module,
65
+ zephyr_lora_files):
66
+
67
+ use_v1 = request.param
68
+ monkeypatch_module.setenv('VLLM_USE_V1', '1' if use_v1 else '0')
69
+
70
# Define the json format LoRA module configurations
71
lora_module_1 = {
72
"name": "zephyr-lora",
vllm/entrypoints/openai/serving_models.py
+1
-1
@@ -162,7 +162,7 @@ class OpenAIServingModels:
162
except BaseException as e:
163
error_type = "BadRequestError"
164
status_code = HTTPStatus.BAD_REQUEST
165
- if isinstance(e, ValueError) and "No adapter found" in str(e):
165
+ if "No adapter found" in str(e):
166
error_type = "NotFoundError"
167
status_code = HTTPStatus.NOT_FOUND
168