mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-14 06:55:01 +08:00
[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>
This commit is contained in:
parent
6d531ad7b8
commit
1286211f57
@ -23,7 +23,19 @@ LORA_NAME = "typeof/zephyr-7b-beta-lora"
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
def llm():
|
def monkeypatch_module():
|
||||||
|
from _pytest.monkeypatch import MonkeyPatch
|
||||||
|
mpatch = MonkeyPatch()
|
||||||
|
yield mpatch
|
||||||
|
mpatch.undo()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="module", params=[False, True])
|
||||||
|
def llm(request, monkeypatch_module):
|
||||||
|
|
||||||
|
use_v1 = request.param
|
||||||
|
monkeypatch_module.setenv('VLLM_USE_V1', '1' if use_v1 else '0')
|
||||||
|
|
||||||
# pytest caches the fixture so we use weakref.proxy to
|
# pytest caches the fixture so we use weakref.proxy to
|
||||||
# enable garbage collection
|
# enable garbage collection
|
||||||
llm = LLM(model=MODEL_NAME,
|
llm = LLM(model=MODEL_NAME,
|
||||||
|
|||||||
@ -53,7 +53,20 @@ def zephyr_lora_files():
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
def server_with_lora_modules_json(zephyr_lora_files):
|
def monkeypatch_module():
|
||||||
|
from _pytest.monkeypatch import MonkeyPatch
|
||||||
|
mpatch = MonkeyPatch()
|
||||||
|
yield mpatch
|
||||||
|
mpatch.undo()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="module", params=[False, True])
|
||||||
|
def server_with_lora_modules_json(request, monkeypatch_module,
|
||||||
|
zephyr_lora_files):
|
||||||
|
|
||||||
|
use_v1 = request.param
|
||||||
|
monkeypatch_module.setenv('VLLM_USE_V1', '1' if use_v1 else '0')
|
||||||
|
|
||||||
# Define the json format LoRA module configurations
|
# Define the json format LoRA module configurations
|
||||||
lora_module_1 = {
|
lora_module_1 = {
|
||||||
"name": "zephyr-lora",
|
"name": "zephyr-lora",
|
||||||
|
|||||||
@ -162,7 +162,7 @@ class OpenAIServingModels:
|
|||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
error_type = "BadRequestError"
|
error_type = "BadRequestError"
|
||||||
status_code = HTTPStatus.BAD_REQUEST
|
status_code = HTTPStatus.BAD_REQUEST
|
||||||
if isinstance(e, ValueError) and "No adapter found" in str(e):
|
if "No adapter found" in str(e):
|
||||||
error_type = "NotFoundError"
|
error_type = "NotFoundError"
|
||||||
status_code = HTTPStatus.NOT_FOUND
|
status_code = HTTPStatus.NOT_FOUND
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user