Skip to content

Commit 2dc3d62

Browse files
sjmonsonmarkurtzCopilot
authored
Restrict rate to only floats (#164)
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 --------- Co-authored-by: Mark Kurtz <mark.j.kurtz@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 678adea commit 2dc3d62

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/guidellm/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def parse_number_str(ctx, param, value): # noqa: ARG001
3131
values = value.split(",") if "," in value else [value]
3232

3333
try:
34-
return [int(val) if val.isdigit() else float(val) for val in values]
34+
return [float(val) for val in values]
3535
except ValueError as err:
3636
raise click.BadParameter(
3737
f"{param.name} must be a number or comma-separated list of numbers."

src/guidellm/benchmark/entrypoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async def benchmark_generative_text(
3838
data_args: Optional[dict[str, Any]],
3939
data_sampler: Optional[Literal["random"]],
4040
rate_type: Union[StrategyType, ProfileType],
41-
rate: Optional[Union[int, float, list[Union[int, float]]]],
41+
rate: Optional[Union[float, list[float]]],
4242
max_seconds: Optional[float],
4343
max_requests: Optional[int],
4444
warmup_percent: Optional[float],

0 commit comments

Comments
 (0)