From f9a0dbe2bfebab3c640d82c2903f23b2a20ebb19 Mon Sep 17 00:00:00 2001 From: Philip Kiely - Baseten <98474633+philipkiely-baseten@users.noreply.github.com> Date: Thu, 9 Mar 2023 23:24:28 +0000 Subject: [PATCH 1/3] publish RC version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f82d1d2a4..08857880f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "truss" -version = "0.3.5rc1" +version = "0.4.0rc1" description = "A seamless bridge from model development to model delivery" license = "MIT" readme = "README.md" From 7ef06466c745c7e1350aa5fdefb34d5b5efcf79c Mon Sep 17 00:00:00 2001 From: Philip Kiely - Baseten <98474633+philipkiely-baseten@users.noreply.github.com> Date: Fri, 10 Mar 2023 00:43:05 +0000 Subject: [PATCH 2/3] fix up integration tests --- truss/tests/conftest.py | 4 +--- truss/tests/test_truss_handle.py | 18 ++++++++---------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/truss/tests/conftest.py b/truss/tests/conftest.py index 8fa7c870c..25c60c897 100644 --- a/truss/tests/conftest.py +++ b/truss/tests/conftest.py @@ -226,9 +226,7 @@ def load(*args, **kwargs): def preprocess(self, model_input): # Adds 1 to all - return { - 'inputs': [value + 1 for value in model_input], - } + return [value + 1 for value in model_input] def predict(self, model_input): return { diff --git a/truss/tests/test_truss_handle.py b/truss/tests/test_truss_handle.py index 05c29536b..dd3dcb48a 100644 --- a/truss/tests/test_truss_handle.py +++ b/truss/tests/test_truss_handle.py @@ -81,8 +81,6 @@ def test_readme_generation_str_example( ): th = TrussHandle(custom_model_truss_dir_with_pre_and_post_str_example) readme_contents = th.generate_readme() - with open("tmp.md", "w") as f: - f.write(readme_contents) readme_contents = readme_contents.replace("\n", "") correct_readme_contents = _read_readme("readme_str_example.md") assert readme_contents == correct_readme_contents @@ -578,8 +576,8 @@ def test_control_truss_apply_patch(custom_model_control): running_hash = th.truss_hash_on_serving_container() new_model_code = """ class Model: - def predict(self, request): - return [2 for i in request['inputs']] + def predict(self, model_input): + return [2 for i in model_input] """ patch_request = { "hash": "dummy", @@ -620,8 +618,8 @@ def test_regular_truss_local_update_flow(custom_model_truss_dir): model_code_file.write( """ class Model: - def predict(self, request): - return [2 for i in request['inputs']] + def predict(self, model_input): + return [2 for i in model_input] """ ) result = th.docker_predict([1], tag=tag) @@ -681,8 +679,8 @@ def test_control_truss_local_update_flow(binary, python_version, custom_model_co def predict_with_updated_model_code(): new_model_code = """ class Model: - def predict(self, request): - return [2 for i in request['inputs']] + def predict(self, model_input): + return [2 for i in model_input] """ model_code_file_path = custom_model_control / "model" / "model.py" with model_code_file_path.open("w") as model_code_file: @@ -803,8 +801,8 @@ def malformed # Should be able to fix code after good_model_code = """ class Model: - def predict(self, request): - return [2 for i in request['inputs']] + def predict(self, model_input): + return [2 for i in model_input] """ with model_code_file_path.open("w") as model_code_file: model_code_file.write(good_model_code) From 54401f92e36663de1bd02e283aaa0c515e2a656c Mon Sep 17 00:00:00 2001 From: Philip Kiely - Baseten <98474633+philipkiely-baseten@users.noreply.github.com> Date: Fri, 10 Mar 2023 01:37:07 +0000 Subject: [PATCH 3/3] undo version bump --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 08857880f..f82d1d2a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "truss" -version = "0.4.0rc1" +version = "0.3.5rc1" description = "A seamless bridge from model development to model delivery" license = "MIT" readme = "README.md"