Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions cornac/serving/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
)

Expand Down
3 changes: 1 addition & 2 deletions docs/source/user/iamadeveloper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading