Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

[opt] add timeout option #145

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/opt/opt_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
executor_max_batch_size = 16
cache_size = 50
cache_list_size = 2
timeout_keep_alive = 180
4 changes: 3 additions & 1 deletion examples/opt/opt_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def launch_engine(model_class,
cache_size: int = 50,
cache_list_size: int = 1,
fixed_cache_keys: list = [],
timeout_keep_alive: int = 60,
):
if allow_cors:
app.add_middleware(
Expand Down Expand Up @@ -112,6 +113,7 @@ def launch_engine(model_class,
executor.start()

global server
config = uvicorn.Config(app, host=server_host, port=server_port, log_level=log_level)
config = uvicorn.Config(app, host=server_host, port=server_port,
log_level=log_level, timeout_keep_alive=timeout_keep_alive)
server = uvicorn.Server(config=config)
server.run()