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

feat: add --disable-prompt-logprobs argument #95

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion src/vllm_tgis_adapter/grpc/grpc_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def __init__(
self.max_max_new_tokens = args.max_new_tokens
self.skip_special_tokens = not args.output_special_tokens
self.default_include_stop_seqs = args.default_include_stop_seqs
self.disable_prompt_logprobs = args.disable_prompt_logprobs

# Backwards compatibility for TGIS: PREFIX_STORE_PATH
adapter_cache_path = args.adapter_cache or args.prefix_store_path
Expand Down Expand Up @@ -606,7 +607,9 @@ async def _validate_and_convert_params(
try:
sampling_params = SamplingParams(
logprobs=logprobs,
prompt_logprobs=logprobs if resp_options.input_tokens else None,
prompt_logprobs=logprobs
if not self.disable_prompt_logprobs and resp_options.input_tokens
else None,
max_tokens=max_new_tokens,
min_tokens=min_new_tokens,
repetition_penalty=with_default(decoding.repetition_penalty, 1.0),
Expand Down
2 changes: 2 additions & 0 deletions src/vllm_tgis_adapter/tgis_utils/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def add_tgis_args(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
parser.add_argument("--speculator-max-batch-size", type=int)
# allow re-enabling vllm native per-request logging
parser.add_argument("--enable-vllm-log-requests", type=bool, default=False)
# set to true to disable producing prompt logprobs on all requests
parser.add_argument("--disable-prompt-logprobs", type=bool, default=False)

# TODO check/add other args here

Expand Down