Skip to content

Commit

Permalink
Main: Switch to entrypoint
Browse files Browse the repository at this point in the history
Allows for other modules to access the startup function.

Signed-off-by: kingbri <[email protected]>
  • Loading branch information
bdashore3 committed Dec 27, 2023
1 parent e92ef8f commit a71b96a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,10 @@ async def generator():
return response


if __name__ == "__main__":
def entrypoint():
"""Entry function for program startup"""
global MODEL_CONTAINER

# Load from YAML config
read_config_from_file(pathlib.Path("config.yml"))

Expand Down Expand Up @@ -522,3 +525,6 @@ async def generator():
port=network_config.get("port", 5000),
log_level="debug",
)

if __name__ == "__main__":
entrypoint()

0 comments on commit a71b96a

Please sign in to comment.