Simplify bench_latency.py (#1503)

This commit is contained in:
Lianmin Zheng
2024-09-24 17:42:07 -07:00
committed by GitHub
parent e6692bf4a5
commit 067d8e16fc
2 changed files with 2 additions and 14 deletions

View File

@@ -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:

View File

@@ -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)