Skip to content
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 Operator for Implicit Models #134

Merged
merged 20 commits into from
Aug 15, 2022
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
20d16ec
Add first version of PredictImplicit operator
oliverholworthy Jul 11, 2022
c81dc28
Add module and class names to config to be able to re-load model
oliverholworthy Jul 11, 2022
f7c8b52
Set filter_already_liked_items=False so that user_items is not required
oliverholworthy Jul 11, 2022
9c7fa2b
Add ensemble test for PredictImplicit
oliverholworthy Jul 11, 2022
b59cd94
Add workflow for implicit op
oliverholworthy Jul 11, 2022
9f064a3
Remove depencency on merlin models for tests
oliverholworthy Jul 11, 2022
60e1b24
Add "als" to ci/ignore_codespell_words.txt
oliverholworthy Jul 11, 2022
37a63fe
Update docstring for transform method and remove whitespace
oliverholworthy Jul 11, 2022
5ea4551
Add 'n' (number of items to recommend) to the inputs of the op
oliverholworthy Jul 11, 2022
0c05223
Update implicit tests to check muliple user ids and use grpcclient
oliverholworthy Aug 2, 2022
4bd4c30
Add check for implicit version
oliverholworthy Aug 2, 2022
d591a11
Uncomment ensemble tests for als/lmf
oliverholworthy Aug 2, 2022
809b3a7
Move num_to_recommend from request argument to predict op constructor
oliverholworthy Aug 2, 2022
d108a0e
Update from_config signature to be consistent with others
oliverholworthy Aug 2, 2022
996b505
Pass in num_to_recommend with keyword argument to recommend in tests
oliverholworthy Aug 2, 2022
94d46c5
Rename test for config for clarity
oliverholworthy Aug 2, 2022
413f554
Specify low for random num_to_recommend to avoid zero
oliverholworthy Aug 2, 2022
8ba0eb4
Merge branch 'main' into op-implicit
karlhigley Aug 15, 2022
50855cc
Remove workflow for implicit and add package to requirements-test
oliverholworthy Aug 15, 2022
a4990ac
Correct function handling TritonPythonModel model_repository
oliverholworthy Aug 15, 2022
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
15 changes: 7 additions & 8 deletions merlin/systems/triton/oprunner_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,13 @@ def execute(self, requests):

def _parse_model_repository(model_repository: str) -> str:
"""
Extract the model repository path from the value passed to the TritonPythonModel
initialize method.
Extract the model repository path from the model_repository value
passed to the TritonPythonModel initialize method.
"""
model_repository_path = pathlib.Path(model_repository).parent

# Handle bug in Tritonserver 22.06
# model_repository argument became path to model.py
if str(model_repository).endswith(".py"):
model_repository_path = model_repository_path.parent

return str(model_repository_path)
# instead of path to model directory within the model repository
if model_repository.endswith(".py"):
return str(pathlib.Path(model_repository).parent.parent.parent)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example:

import pathlib

pathlib.Path("/tmp/my_model_repository/my_model_name/1/model.py").parent.parent.parent
# => PosixPath('/tmp/my_model_repository')

else:
return str(pathlib.Path(model_repository).parent)