Open
Conversation
This is done in the same fashion as BasePatchEncoder QC check: - Add an attribute _has_internet to BaseSlideEncoder which is used by ensure_has_internet - Add an attribute weights_path, which can optionnaly be set during init - Add a method ensure_valid_weights_path to verify that the provided weights path is valid - Add a method ensure_has_internet to verify that the online model can be loaded - Add a method _get_weights_path which will use self.weights_path if provided or check the model registry to get the weights_path otherwise. In both cases, the validity of the path will be checked using ensure_valid_weights_path.
Use the newly added _get_weights_path method to use an optional weights_path given during init or look at the path in the model registry. If a valid path is found, the load the offline model from there. Otherwise, ensure that there is an internet access, then use the online version of Titan.
Add the key "titan" to local_ckpts.json and leave the path empty, as done in patch encoder models.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements a local version of Titan to avoid the boilerplate described in #118.
Specifically, it adds:
As mentioned in #118, the files in Titan may need some updates to run correctly in Trident.
This is something that I did not do in this PR, as I am unsure if this may be updated in the Titan repo later on.