-
Notifications
You must be signed in to change notification settings - Fork 50
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
Read embeddings config during bootstrap/load and instance creation #387
Conversation
When CONFIG_FILES setting is not used, the caikit-nlp config values are not read from environment variables unless caikit has already imported caikit-nlp. The code was loading the embedding config too soon in this case so the env vars were ignored. This commit reads the config during bootstrap and load for settings that are needed at bootstrap/load time and also reads config during module init for runtime settings. In addition: * bootstrap() kwargs can be used (e.g. for trust_remote_code param) * load() was made to work with model_path as ModuleConfig (because str is deprecated and spammy) * utils/env_val_to_int was removed because the caikit config handles this well * utils/env_val_to_bool was NOT YET removed because the caikit config does not handle this quite as well Signed-off-by: Mark Sturdevant <[email protected]>
91d83be
to
272eeb1
Compare
assert 1 == conf.get("true", expected_default) | ||
assert 1 == int(conf.get("true", expected_default)) | ||
|
||
assert "oh-oh" == conf.get("non_int", 123) # default not used (got "uh-oh") |
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.
nit: oh-oh
with the given example instead of uh-oh
in comments?
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.
clarified with "non int str"
ModuleConfig should always have a model_path, but this check will make the error better if this gets called with an empty ModuleConfig. Signed-off-by: Mark Sturdevant <[email protected]>
Signed-off-by: Mark Sturdevant <[email protected]>
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.
LGTM - thanks for the updates!
When CONFIG_FILES setting is not used, the caikit-nlp config values are not read from environment variables unless caikit has already imported caikit-nlp. The code was loading the embedding config too soon in this case so the env vars were ignored.
This commit reads the config during bootstrap and load for settings that are needed at bootstrap/load time and also reads config during module init for runtime settings.
In addition: