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

Sherif akoush/quickfix/create artifacts on fly #374

Merged

Conversation

sakoush
Copy link
Member

@sakoush sakoush commented Nov 5, 2021

Create alibi test artifacts on-the-fly

Copy link
Contributor

@adriangonz adriangonz left a comment

Choose a reason for hiding this comment

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

Nice one! Looks great! I've just added a couple comments to get your thoughts, but it should be ready to go.

@@ -120,8 +124,16 @@ def rest_client(rest_app: FastAPI) -> TestClient:
return TestClient(rest_app)


@pytest.fixture
def anchor_image_directory() -> Path:
if not _ANCHOR_IMAGE_DIR.exists():
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we always write the model to a temporary dir (we could leverage pytest's tmp_path fixture for this)? Or do you think it's worth it to keep the "cached" artifact between tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah I felt that locally we might want to look at the models that we created and perhaps not incur the overhead of creating them every time (locally)

@@ -174,11 +186,19 @@ async def integrated_gradients_runtime() -> AlibiExplainRuntime:
extra=AlibiExplainSettings(
init_parameters={"n_steps": 50, "method": "gausslegendre"},
explainer_type="integrated_gradients",
infer_uri=str(TESTS_PATH / "data" / "tf_mnist" / "model.h5"),
infer_uri=str(get_tf_mnist_model_uri()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly to the comment above, should we always train the model and save it to a temporary path?

Copy link
Member Author

Choose a reason for hiding this comment

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

if it starts causing us issues lets do tmpdir but for now it seems that it is more useful to have the models cached as you mentioned.

@sakoush sakoush merged commit 42eac47 into SeldonIO:master Nov 9, 2021
sakoush added a commit to sakoush/MLServer that referenced this pull request Nov 24, 2021
* train models on the fly

* delete artifacts as we create them on the fly

* lint, format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants