Skip to content

Commit

Permalink
fix app creation
Browse files Browse the repository at this point in the history
  • Loading branch information
shifucun committed May 25, 2024
1 parent 1448fff commit dd41575
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nl_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit dd41575

Please sign in to comment.