Skip to content

Commit 3bc1175

Browse files
scottzh8Scott Zhang
andauthored
[Bugfix] Fix host and port join for ipv6 in bench serve (#28679)
Signed-off-by: Scott Zhang <scottzh@fb.com> Co-authored-by: Scott Zhang <scottzh@fb.com>
1 parent af02c40 commit 3bc1175

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

vllm/benchmarks/serve.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
from vllm.benchmarks.lib.utils import convert_to_pytorch_benchmark_format, write_to_json
5050
from vllm.transformers_utils.tokenizer import get_tokenizer
5151
from vllm.utils.gc_utils import freeze_gc_heap
52+
from vllm.utils.network_utils import join_host_port
5253

5354
MILLISECONDS_TO_SECONDS_CONVERSION = 1000
5455

@@ -1333,8 +1334,9 @@ async def main_async(args: argparse.Namespace) -> dict[str, Any]:
13331334
api_url = f"{args.base_url}{args.endpoint}"
13341335
base_url = f"{args.base_url}"
13351336
else:
1336-
api_url = f"http://{args.host}:{args.port}{args.endpoint}"
1337-
base_url = f"http://{args.host}:{args.port}"
1337+
host_port = join_host_port(args.host, args.port)
1338+
api_url = f"http://{host_port}{args.endpoint}"
1339+
base_url = f"http://{host_port}"
13381340

13391341
# Headers
13401342
headers = None

0 commit comments

Comments
 (0)