Skip to content

Commit 36a0230

Browse files
committed
format code
Signed-off-by: zibai <[email protected]>
1 parent 057b6b1 commit 36a0230

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

benchmarks/backend_request_func.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class RequestFuncOutput:
4444

4545

4646
async def async_request_tgi(
47-
request_func_input: RequestFuncInput,
48-
pbar: Optional[tqdm] = None,
47+
request_func_input: RequestFuncInput,
48+
pbar: Optional[tqdm] = None,
4949
) -> RequestFuncOutput:
5050
api_url = request_func_input.api_url
5151
assert api_url.endswith("generate_stream")
@@ -116,8 +116,8 @@ async def async_request_tgi(
116116

117117

118118
async def async_request_trt_llm(
119-
request_func_input: RequestFuncInput,
120-
pbar: Optional[tqdm] = None,
119+
request_func_input: RequestFuncInput,
120+
pbar: Optional[tqdm] = None,
121121
) -> RequestFuncOutput:
122122
api_url = request_func_input.api_url
123123
assert api_url.endswith("generate_stream")
@@ -183,8 +183,8 @@ async def async_request_trt_llm(
183183

184184

185185
async def async_request_deepspeed_mii(
186-
request_func_input: RequestFuncInput,
187-
pbar: Optional[tqdm] = None,
186+
request_func_input: RequestFuncInput,
187+
pbar: Optional[tqdm] = None,
188188
) -> RequestFuncOutput:
189189
async with aiohttp.ClientSession(timeout=AIOHTTP_TIMEOUT) as session:
190190
assert request_func_input.best_of == 1
@@ -226,8 +226,8 @@ async def async_request_deepspeed_mii(
226226

227227

228228
async def async_request_openai_completions(
229-
request_func_input: RequestFuncInput,
230-
pbar: Optional[tqdm] = None,
229+
request_func_input: RequestFuncInput,
230+
pbar: Optional[tqdm] = None,
231231
) -> RequestFuncOutput:
232232
api_url = request_func_input.api_url
233233
assert api_url.endswith(
@@ -317,8 +317,8 @@ async def async_request_openai_completions(
317317

318318

319319
async def async_request_openai_chat_completions(
320-
request_func_input: RequestFuncInput,
321-
pbar: Optional[tqdm] = None,
320+
request_func_input: RequestFuncInput,
321+
pbar: Optional[tqdm] = None,
322322
) -> RequestFuncOutput:
323323
api_url = request_func_input.api_url
324324
assert api_url.endswith(
@@ -420,10 +420,10 @@ def get_model(pretrained_model_name_or_path: str) -> str:
420420

421421

422422
def get_tokenizer(
423-
pretrained_model_name_or_path: str,
424-
tokenizer_mode: str = "auto",
425-
trust_remote_code: bool = False,
426-
**kwargs,
423+
pretrained_model_name_or_path: str,
424+
tokenizer_mode: str = "auto",
425+
trust_remote_code: bool = False,
426+
**kwargs,
427427
) -> Union[PreTrainedTokenizer, PreTrainedTokenizerFast]:
428428
if pretrained_model_name_or_path is not None and not os.path.exists(
429429
pretrained_model_name_or_path):

benchmarks/benchmark_serving.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,13 +1228,12 @@ def main(args: argparse.Namespace):
12281228
'always use the slow tokenizer. \n* '
12291229
'"mistral" will always use the `mistral_common` tokenizer.')
12301230

1231-
parser.add_argument(
1232-
"--served-model-name",
1233-
type=str,
1234-
default=None,
1235-
help="The model name used in the API. "
1236-
"If not specified, the model name will be the "
1237-
"same as the ``--model`` argument. ")
1231+
parser.add_argument("--served-model-name",
1232+
type=str,
1233+
default=None,
1234+
help="The model name used in the API. "
1235+
"If not specified, the model name will be the "
1236+
"same as the ``--model`` argument. ")
12381237

12391238
args = parser.parse_args()
12401239
main(args)

0 commit comments

Comments
 (0)