@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 27d0952600
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 09:45 UTC

[Misc] extract parser.parse_args() (#18323)

Signed-off-by: reidliu41 <reid201711@gmail.com> Co-authored-by: reidliu41 <reid201711@gmail.com>

Reid committed May 19, 2025 at 12:06 UTC 27d09526006a8d437874628d6905df12f80a194f
2 files changed +12 -4
examples/offline_inference/qwen2_5_omni/only_thinker.py
+6 -2
@@ -140,7 +140,7 @@ def main(args):
140 print(generated_text)
141
142
143 -if __name__ == "__main__":
143 +def parse_args():
144 parser = FlexibleArgumentParser(
145 description='Demo on using vLLM for offline inference with '
146 'audio language models')
@@ -155,5 +155,9 @@ if __name__ == "__main__":
155 default=None,
156 help="Set the seed when initializing `vllm.LLM`.")
157
158 - args = parser.parse_args()
158 + return parser.parse_args()
159 +
160 +
161 +if __name__ == "__main__":
162 + args = parse_args()
163 main(args)
examples/online_serving/disaggregated_serving/disagg_proxy_demo.py
+6 -2
@@ -414,7 +414,7 @@ class ProxyServer:
414 server.run()
415
416
417 -if __name__ == "__main__":
417 +def parse_args():
418 # Todo: allow more config
419 parser = argparse.ArgumentParser("vLLM disaggregated proxy server.")
420 parser.add_argument("--model",
@@ -445,6 +445,10 @@ if __name__ == "__main__":
445 default=8000,
446 help="Server port number",
447 )
448 - args = parser.parse_args()
448 + return parser.parse_args()
449 +
450 +
451 +if __name__ == "__main__":
452 + args = parse_args()
453 proxy_server = ProxyServer(args=args)
454 proxy_server.run_server()