[Misc] Normalize --host parameter to use plain hostname without scheme (#19309)

Co-authored-by: 墨楼 <huangzhilin.hzl@antgroup.com>
Co-authored-by: Liangsheng Yin <lsyincs@gmail.com>
Co-authored-by: Liangsheng Yin <hnyls2002@gmail.com>
This commit is contained in:
Julian Huang
2026-02-25 00:37:24 -08:00
committed by GitHub
co-authored by 墨楼 Liangsheng Yin Liangsheng Yin
parent f75abb4521
commit a55f658835
8 changed files with 52 additions and 25 deletions
@@ -19,6 +19,8 @@ import json
import aiohttp
import requests
from sglang.utils import normalize_base_url
IMAGE_TOKEN_SEP = "\n[IMG]"
ROUTE = "/generate"
@@ -32,7 +34,7 @@ async def send_request(url, data, delay=0):
async def test_concurrent(args):
url = f"{args.host}:{args.port}{ROUTE}"
url = f"{normalize_base_url(args.host, args.port)}{ROUTE}"
# Single image test
if args.single_image:
@@ -69,7 +71,7 @@ async def test_concurrent(args):
def test_streaming(args):
url = f"{args.host}:{args.port}/generate"
url = f"{normalize_base_url(args.host, args.port)}/generate"
# Single image test
if args.single_image:
@@ -112,7 +114,7 @@ def test_streaming(args):
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--host", type=str, default="http://127.0.0.1")
parser.add_argument("--host", type=str, default="127.0.0.1")
parser.add_argument("--port", type=int, default=30000)
parser.add_argument(
"--single-image",