Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support disable_ignore_eos in bench_serving.py #824

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading