-
Notifications
You must be signed in to change notification settings - Fork 157
Add production version of API serving #547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add production version of API serving #547
Conversation
@darrylong are we planning to have a tutorial on best practices for using this API service? |
@tqtg Yes we should! I'll include a readme in the directory, also with the developer documentation? |
that would be great! Let me see how we can combine this with our current serving API. In the meantime, maybe you could help with a tutorial/guide on using this with wsgi server too. |
@darrylong I've updated to use Flask app as the default way to serve model. I think it's better than maintaining different versions. Let me know if we're good with this approach, then we can develop user guide accordingly. |
@tqtg Hey thanks for the changes, they look great to me. I'm okay with Flask being used as the default way. Only thing is that do we want all users to install Flask in order to use Cornac? |
@darrylong that’s a good point. Maybe we don’t have to, and only need to tell users to install Flask as needed |
@tqtg alright! i was thinking maybe we can remove the dependency check from |
Yes. We can do that |
LGTM |
@tqtg Added the changes as discussed. Please have a look and feel free to edit or merge. Thanks! |
Description
API serving is ported to run on Flask. Flask dependency is required to run this version of serving.
In this PR, API serving have been changed to the following form:
Flask --> Gunicorn (WSGI HTTP Server)
Changes
To run in development mode:
Run
MODEL_DIR='saved_models/bpr' MODEL_CLASS='cornac.models.BPR' flask run
whereMODEL_DIR
andMODEL_CLASS
are saved model directory and the class of the models respectively.Related Issues
Checklist:
README.md
(if you are adding a new model).examples/README.md
(if you are adding a new example).datasets/README.md
(if you are adding a new dataset).