From dd41575db3e9755dfa22fb1ca6499e45bce88bcf Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Fri, 24 May 2024 20:31:06 -0700 Subject: [PATCH] fix app creation --- nl_server/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nl_server/__init__.py b/nl_server/__init__.py index 763f6e298a..8e59ed3789 100644 --- a/nl_server/__init__.py +++ b/nl_server/__init__.py @@ -47,9 +47,6 @@ def create_app(): if sys.version_info >= (3, 8) and sys.platform == "darwin": torch.set_num_threads(1) - app = Flask(__name__) - app.register_blueprint(routes.bp) - # Build the registry before creating the Flask app to make sure all resources # are loaded. try: @@ -65,6 +62,8 @@ def create_app(): # result = search.search_vars([embeddings], [query]).get(query) # if not result or not result.svs: # raise Exception(f'Registry does not have default index {idx_type}') + app = Flask(__name__) + app.register_blueprint(routes.bp) app.config[registry.REGISTRY_KEY] = reg logging.info('NL Server Flask app initialized') return app