Simplify bench_latency.py (#1503)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user