-
Notifications
You must be signed in to change notification settings - Fork 157
Add simple model serving #540
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
Conversation
README.md
Outdated
``` | ||
Here you go, your model service is now ready. Let's get `top-5` item recommendations for the user `"63"`: | ||
```bash | ||
$ curl http://127.0.0.1:8080/recommend \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using GET request instead of using POST for this purpose. We can also use request query such as ?uid=63&k=5
in replacement of request body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment. The reason we put data in the json body is because uid
is raw string ID of user in the original data, not the integer index. We just try to avoid any encoding issue for cases where uid
contains special characters/white spaces. With that said, those cases are rare and we can consider switching to GET request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@darrylong @hieuddo what do you guys think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. I think we can develop more user-friendly queries in the future. Is that the further goal, or only provide API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tqtg Since we are obtaining recommendations, I think GET seems more appropriate just not to complicate the developers. I think string uid
should work as well in GET, unless there are unique formats?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed to GET request. We can change to POST later if we face real encoding issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Adding a simple method to serve model with launching a standalone web service. Good enough for model testing or creating a demo application.
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).