diff --git a/README.md b/README.md index 52055439b..4c4f72c64 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 # requires Flask>=2.2 (older Flask: FLASK_APP='cornac.serving.app' flask run ...) # Running on http://localhost:8080 ``` diff --git a/cornac/serving/app.py b/cornac/serving/app.py index ffa8c0717..eb47db492 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. """ ) diff --git a/docs/source/user/iamadeveloper.rst b/docs/source/user/iamadeveloper.rst index 28423e9fd..cf5303571 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: