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

Required changes to get Rank example test passing #182

Merged
merged 1 commit into from
Aug 24, 2022
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
4 changes: 3 additions & 1 deletion examples/Serving-Ranking-Models-With-Merlin-Systems.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1049,9 +1049,11 @@
"\n",
"inputs = convert_df_to_triton_input(workflow.input_schema.column_names, batch, grpcclient.InferInput)\n",
"\n",
"output_cols = ensemble.graph.output_schema.column_names\n",
"\n",
"outputs = [\n",
" grpcclient.InferRequestedOutput(col)\n",
" for col in ensemble.graph.output_schema.column_names\n",
" for col in output_cols\n",
"]"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,24 @@ def test_example_04_exporting_ranking_models(tb):
NUM_OF_CELLS = len(tb.cells)
tb.execute_cell(list(range(0, NUM_OF_CELLS - 12)))
tb.execute_cell(list(range(NUM_OF_CELLS - 9, NUM_OF_CELLS - 6)))
tb.inject(
"""
import shutil
from merlin.models.loader.tf_utils import configure_tensorflow
configure_tensorflow()
from merlin.systems.triton.utils import run_ensemble_on_tritonserver
outputs = ensemble.graph.output_schema.column_names
response = run_ensemble_on_tritonserver(
"/tmp/data/ensemble/", outputs, batch, "ensemble_model"
)
response = [x.tolist()[0] for x in response["click/binary_classification_task"]]
#shutil.rmtree("/tmp/data/", ignore_errors=True)
"""
from merlin.core.dispatch import get_lib

df_lib = get_lib()

# original_data_path = os.environ.get("INPUT_FOLDER", "/workspace/data/")

# read in data for request
batch = df_lib.read_parquet(
os.path.join("/tmp/data/", "valid", "part.0.parquet"),
num_rows=3,
columns=workflow.input_schema.column_names,
)
tb.execute_cell(NUM_OF_CELLS - 6)
response = tb.ref("response")
assert len(response) == 3
batch = batch.drop(columns="click")
outputs = tb.ref("output_cols")
from merlin.models.loader.tf_utils import configure_tensorflow

configure_tensorflow()
from merlin.systems.triton.utils import run_ensemble_on_tritonserver

response = run_ensemble_on_tritonserver("/tmp/data/ensemble/", outputs, batch, "ensemble_model")
assert len(response["click/binary_classification_task"]) == 3