Skip to content

Conversation

sjmonson
Copy link
Collaborator

We already support casting floats to int so to simplify the arg code and solve an issue with older pythons just treat all input as floats.

Fixes #163

@sjmonson sjmonson requested review from Copilot and markurtz May 15, 2025 16:01
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR restricts the rate input strictly to floats to simplify code and address compatibility issues with older Python versions.

  • Updated the type annotation for the "rate" parameter in benchmark_generative_text to only allow floats or list of floats.
  • Simplified the conversion logic in the CLI parser by removing int conversion in favor of always using float conversion.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/guidellm/benchmark/entrypoints.py Updated the type annotation for "rate" to restrict to floats.
src/guidellm/main.py Removed int conversion so that number parsing always returns floats.
Comments suppressed due to low confidence (1)

src/guidellm/benchmark/entrypoints.py:41

  • The update to only accept floats for the rate parameter is clear; ensure all related documentation and usage context reflect that the parameter no longer supports integers.
rate: Optional[Union[float, list[float]]],

markurtz
markurtz previously approved these changes May 15, 2025
@sjmonson
Copy link
Collaborator Author

@markurtz the Copilot suggestion is bad since the number can still be an int on the cmdline it will just be interpreted as a float.

@sjmonson sjmonson requested a review from markurtz May 15, 2025 17:27
@markurtz markurtz merged commit 2dc3d62 into vllm-project:main May 15, 2025
9 of 11 checks passed
@sjmonson sjmonson deleted the fix/int_casting branch May 15, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python 3.9 does not support int.is_integer()

2 participants