Skip to content
Snippets Groups Projects

Add model version id as worker attribute

Merged Yoann Schneider requested to merge model-version-id-attribute into master
3 files
+ 10
0
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -198,6 +198,9 @@ class BaseWorker(object):
"'ARKINDEX_CORPUS_ID' was not set in the environment. Any API request involving a `corpus_id` will fail."
)
# Define model_version_id from environment
self.model_version_id = os.environ.get("ARKINDEX_MODEL_VERSION_ID")
# Load all required secrets
self.secrets = {name: self.load_secret(name) for name in required_secrets}
@@ -258,6 +261,9 @@ class BaseWorker(object):
logger.info("Loaded model version configuration from WorkerRun")
self.model_configuration.update(model_version.get("configuration"))
# Set model_version ID as worker attribute
self.model_version_id = model_version.get("id")
# if debug mode is set to true activate debug mode in logger
if self.user_configuration.get("debug"):
logger.setLevel(logging.DEBUG)
Loading