[feat] support external custom models - #635
Draft
tiankongdeguiji wants to merge 1 commit into
Draft
Conversation
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.
Summary
CustomModelentry backed bygoogle.protobuf.Anytzrec_custom.modelspackage, withTZREC_CUSTOM_PACKAGEsupportBaseModelscripts/gen_proto.shMotivation
The previous custom-model workflow required each user model to edit shared model proto files. Those edits regularly conflict with upstream changes during merge or rebase. This change keeps user model code and proto definitions in an independent package while preserving reuse of shared messages such as
MLP.User impact
A custom package can contain multiple models under
<package>.modelsand their configs under<package>.protos. Pipeline configs select a model by fullclass_pathand embed its strongly typed config throughAny. The default package istzrec_custom; other package roots can be selected before startup withTZREC_CUSTOM_PACKAGE.Test Plan
PYTHONPATH=. conda run -n tzrec130 python -m unittest tzrec.utils.load_class_test tzrec.utils.config_util_test tzrec.main_testPYTHONPATH=. conda run -n tzrec130 pre-commit run -ascripts/gen_proto.sh, then verified package auto-import,Anyparsing, and custom model creation in a fresh Python processPYTHONPATH=. conda run -n tzrec130 python scripts/pyre_check.py; Pyre could not start because the existing upstream.pyre_configurationcontains invalid JSON (a trailing comma)