-
Notifications
You must be signed in to change notification settings - Fork 183
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
Sherif akoush/quickfix/create artifacts on fly #374
Conversation
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.
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(): |
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.
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?
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.
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()), |
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.
Similarly to the comment above, should we always train the model and save it to a temporary path?
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.
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.
* train models on the fly * delete artifacts as we create them on the fly * lint, format
Create alibi test artifacts on-the-fly