Skip to content

Commit 2c7790b

Browse files
committed
[fix] reformat the script
1 parent b6177e2 commit 2c7790b

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

tests/python/serve/server/test_server_structural_tag.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020

2121

2222
def check_openai_nonstream_response(
23-
response: Dict,
24-
*,
25-
model: str,
26-
object_str: str,
27-
num_choices: int,
28-
finish_reason: List[str],
29-
completion_tokens: Optional[int] = None,
23+
response: Dict,
24+
*,
25+
model: str,
26+
object_str: str,
27+
num_choices: int,
28+
finish_reason: List[str],
29+
completion_tokens: Optional[int] = None,
3030
):
3131
assert response["model"] == model
3232
assert response["object"] == object_str
@@ -68,16 +68,16 @@ def check_openai_nonstream_response(
6868

6969

7070
def check_openai_stream_response(
71-
responses: List[Dict],
72-
*,
73-
model: str,
74-
object_str: str,
75-
num_choices: int,
76-
finish_reason: str,
77-
echo_prompt: Optional[str] = None,
78-
suffix: Optional[str] = None,
79-
stop: Optional[List[str]] = None,
80-
require_substr: Optional[List[str]] = None,
71+
responses: List[Dict],
72+
*,
73+
model: str,
74+
object_str: str,
75+
num_choices: int,
76+
finish_reason: str,
77+
echo_prompt: Optional[str] = None,
78+
suffix: Optional[str] = None,
79+
stop: Optional[List[str]] = None,
80+
require_substr: Optional[List[str]] = None,
8181
):
8282
assert len(responses) > 0
8383

@@ -137,12 +137,12 @@ def check_openai_stream_response(
137137

138138
def check_format(name_beg: str, name_end: str, beg_tag: str, schema: str):
139139
try:
140-
schema: dict[str, Any] = json.loads(schema)
140+
paras: Dict[str, Any] = json.loads(schema)
141141
except json.JSONDecodeError as e:
142142
print(f"Invalid JSON format: {e}")
143143
assert False
144-
assert "hash_code" in schema
145-
hash_code = schema["hash_code"]
144+
assert "hash_code" in paras
145+
hash_code = paras["hash_code"]
146146
assert hash_code in CHECK_INFO
147147
info = CHECK_INFO[hash_code]
148148
assert name_beg == info["name"]
@@ -239,7 +239,7 @@ def check_format(name_beg: str, name_end: str, beg_tag: str, schema: str):
239239
"state": {
240240
"type": "string",
241241
"description": "the two-letter abbreviation for the state that the city is"
242-
" in, e.g. 'CA' which would mean 'California'",
242+
" in, e.g. 'CA' which would mean 'California'",
243243
},
244244
"unit": {
245245
"type": "string",
@@ -283,7 +283,7 @@ def check_format(name_beg: str, name_end: str, beg_tag: str, schema: str):
283283
"state": {
284284
"type": "string",
285285
"description": "the two-letter abbreviation for the state that the city is"
286-
" in, e.g. 'CA' which would mean 'California'",
286+
" in, e.g. 'CA' which would mean 'California'",
287287
},
288288
"unit": {
289289
"type": "string",
@@ -371,10 +371,10 @@ def check_format(name_beg: str, name_end: str, beg_tag: str, schema: str):
371371
@pytest.mark.parametrize("stream", [False, True])
372372
@pytest.mark.parametrize("messages", CHAT_COMPLETION_MESSAGES)
373373
def test_openai_v1_chat_completion_structural_tag(
374-
served_model: str,
375-
launch_server, # pylint: disable=unused-argument
376-
stream: bool,
377-
messages: List[Dict[str, str]],
374+
served_model: str,
375+
launch_server, # pylint: disable=unused-argument
376+
stream: bool,
377+
messages: List[Dict[str, str]],
378378
):
379379
# `served_model` and `launch_server` are pytest fixtures
380380
# defined in conftest.py.

0 commit comments

Comments
 (0)