From a7e2daff84ee000960559b7d76134e4be6b4931f Mon Sep 17 00:00:00 2001 From: Darryl Ong Date: Fri, 19 Jun 2026 18:47:36 +0800 Subject: [PATCH 1/4] Update serving app command to Flask's new default app flag --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 52055439..95908592 100644 --- a/README.md +++ b/README.md @@ -110,10 +110,9 @@ bpr.save("save_dir", save_trainset=True) ``` After that, the model can be deployed easily by running Cornac serving app as follows: ```bash -$ FLASK_APP='cornac.serving.app' \ - MODEL_PATH='save_dir/BPR' \ +$ MODEL_PATH='save_dir/BPR' \ MODEL_CLASS='cornac.models.BPR' \ - flask run --host localhost --port 8080 + flask --app cornac.serving.app run --host localhost --port 8080 # Running on http://localhost:8080 ``` From 37a0e754b67d792a57fcef528dc5bf4caf449df6 Mon Sep 17 00:00:00 2001 From: Darryl Ong Date: Fri, 19 Jun 2026 18:47:53 +0800 Subject: [PATCH 2/4] Fix typo in print statement --- cornac/serving/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cornac/serving/app.py b/cornac/serving/app.py index ffa8c071..eb47db49 100644 --- a/cornac/serving/app.py +++ b/cornac/serving/app.py @@ -91,8 +91,8 @@ def _load_model(instance_path): "Model loaded" if train_set is None else """ - Model and train set loaded. Remove seen items by adding - remove_seen=true' query param to the recommend endpoint. + Model and train set loaded. Remove seen items by adding + 'remove_seen=true' query param to the recommend endpoint. """ ) From 7b4b13eaede9cc20ead38c8587ec28be6b15d3be Mon Sep 17 00:00:00 2001 From: darrylong Date: Tue, 23 Jun 2026 18:40:40 +0800 Subject: [PATCH 3/4] Include Flask < 2.1 comment as part of docs Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 95908592..4c4f72c6 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ After that, the model can be deployed easily by running Cornac serving app as fo ```bash $ MODEL_PATH='save_dir/BPR' \ MODEL_CLASS='cornac.models.BPR' \ - flask --app cornac.serving.app run --host localhost --port 8080 + flask --app cornac.serving.app run --host localhost --port 8080 # requires Flask>=2.2 (older Flask: FLASK_APP='cornac.serving.app' flask run ...) # Running on http://localhost:8080 ``` From 72af5985904a67d8e400da11ef869257366f3eaa Mon Sep 17 00:00:00 2001 From: Darryl Ong Date: Tue, 23 Jun 2026 18:45:35 +0800 Subject: [PATCH 4/4] Update readthedocs for flask serving change --- docs/source/user/iamadeveloper.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/source/user/iamadeveloper.rst b/docs/source/user/iamadeveloper.rst index 28423e9f..cf530357 100644 --- a/docs/source/user/iamadeveloper.rst +++ b/docs/source/user/iamadeveloper.rst @@ -506,10 +506,9 @@ command: .. code-block:: bash - FLASK_APP='cornac.serving.app' \ MODEL_PATH='save_dir/BPR' \ MODEL_CLASS='cornac.models.BPR' \ - flask run --host localhost --port 8080 + flask --app cornac.serving.app run --host localhost --port 8080 # requires Flask>=2.2 This will serve an API for the BPR model saved in the directory ``save_dir/BPR``. The API will be launched at `localhost:8080` and following output will be shown: