Unverified Commit 067d8e16 authored by Lianmin Zheng's avatar Lianmin Zheng Committed by GitHub
Browse files

Simplify bench_latency.py (#1503)

parent e6692bf4
......@@ -491,18 +491,10 @@ def main(server_args, bench_args):
if __name__ == "__main__":
multiprocessing.set_start_method("spawn", force=True)
parser = argparse.ArgumentParser()
ServerArgs.add_cli_args(parser)
BenchArgs.add_cli_args(parser)
# For this script, model-path is not required
assert (
parser._actions[1].option_strings[0] == "--model-path"
), "options changed, this code need to be updated"
parser._actions[1].required = False
args = parser.parse_args()
server_args = ServerArgs.from_cli_args(args)
bench_args = BenchArgs.from_cli_args(args)
......@@ -511,6 +503,8 @@ if __name__ == "__main__":
format="%(message)s",
)
multiprocessing.set_start_method("spawn", force=True)
try:
main(server_args, bench_args)
except Exception as e:
......
......@@ -174,13 +174,7 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser()
ServerArgs.add_cli_args(parser)
BenchArgs.add_cli_args(parser)
# For this script, model-path is not required
assert (
parser._actions[1].option_strings[0] == "--model-path"
), "options changed, this code need to be updated"
parser._actions[1].required = False
args = parser.parse_args()
server_args = ServerArgs.from_cli_args(args)
bench_args = BenchArgs.from_cli_args(args)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment