Skip to content

Commit

Permalink
Support disable_ignore_eos in bench_serving.py (sgl-project#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ying1123 authored Jul 30, 2024
1 parent a30d5d7 commit ae5c0fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion python/sglang/bench_serving.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ async def async_request_trt_llm(
"min_length": request_func_input.output_len,
"end_id": 1048576,
}
if args.disable_ignore_eos:
del payload["min_length"]
del payload["end_id"]
output = RequestFuncOutput()
output.prompt_len = request_func_input.prompt_len

Expand Down Expand Up @@ -149,7 +152,7 @@ async def async_request_openai_completions(
"best_of": 1,
"max_tokens": request_func_input.output_len,
"stream": not args.disable_stream,
"ignore_eos": True,
"ignore_eos": not args.disable_ignore_eos,
}
headers = {"Authorization": f"Bearer {os.environ.get('OPENAI_API_KEY')}"}

Expand Down Expand Up @@ -969,6 +972,11 @@ def set_ulimit(target_soft_limit=65535):
action="store_true",
help="Disable streaming mode.",
)
parser.add_argument(
"--disable-ignore-eos",
action="store_true",
help="Disable ignoring EOS.",
)

set_ulimit()

Expand Down

0 comments on commit ae5c0fc

Please sign in to comment.