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

Fix Hub Post Install #969

Merged
merged 2 commits into from
Jul 26, 2024
Merged

Fix Hub Post Install #969

merged 2 commits into from
Jul 26, 2024

Conversation

CalebCourier
Copy link
Collaborator

In the recent release the concept of using remote inference with validators was introduced. Along with this came the option to skip installing a validator's ML models with the intention of using said remote inference endpoints instead. While there is a flag to control this behaviour, it was defaulted to skip model installation unless told otherwise.

First, this is a bad assumption since it can leave validators in an unusable state without knowing and referencing the docs for this feature.
Second, post-install is also currently where other hub validators that a particular validator depends on are installed. See #966 as an example of this.

This PR corrects this behaviour by implementing the following:

  • The local_models option defaults to None instead of False
  • We only auto-skip running the post-install if use_remote_inferencing is set to true in the .guardrailsrc and the validator being installed is tagged as having a remote inference endpoint (i.e. module_manifest.tags.has_guardrails_endpoint).
  • The --install-local-models flag always indicates the post-install should be run
  • The --no-install-local-models flag always indicates the post-install should not be run
  • If no flag is passed, and remote inferencing is not to be used (either through settings or lack of support), the post install is run

@CalebCourier CalebCourier requested a review from a team July 26, 2024 18:01
@CalebCourier
Copy link
Collaborator Author

A different and better solution can be implemented once we move the hub to a private pypi registry since the dependee could be included in the pyproject.toml (barring any custom directory work).

Copy link
Contributor

@JosephCatrambone JosephCatrambone left a comment

Choose a reason for hiding this comment

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

Line 273 isn't a dealbreaker but it would be nice to change.

@CalebCourier
Copy link
Collaborator Author

Line 273 isn't a dealbreaker but it would be nice to change.

Addressed

@CalebCourier CalebCourier requested review from JosephCatrambone and a team July 26, 2024 18:31
Copy link
Contributor

@JosephCatrambone JosephCatrambone left a comment

Choose a reason for hiding this comment

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

LGTM

@CalebCourier CalebCourier merged commit dd19c1c into main Jul 26, 2024
12 checks passed
@CalebCourier CalebCourier deleted the fix-post-install branch July 26, 2024 18:39
@zsimjee zsimjee added this to the v0.5.2 release tracker milestone Jul 30, 2024
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.

3 participants