SIENTIAPDE-1214
SIENTIAPDE-1214: Refactor MLFlow and model repository methods to use model_config dictionary - Updated MLFlow class methods to accept model_config instead of model_retention for improved flexibility. - Modified model_repository methods to handle model_config, extracting necessary parameters for transformation and prediction. - Adjusted predictions_batch and prediction_process workflows to utilize model_config for better configuration management. - Commented out the previous sientia-mlops-library dependency in requirements.txt for clarity.
This commit is contained in:
@@ -94,7 +94,7 @@ class MLFlow(BaseActivity):
|
||||
self.info('Transforming data...', metadata)
|
||||
data = DataFrame(input_data['data'])
|
||||
model_name = input_data['model_name']
|
||||
model_retention = input_data['model_retention']
|
||||
model_config = input_data.get('model_config', {})
|
||||
|
||||
self.debug("Raw input data:", metadata)
|
||||
self.debug(data, metadata)
|
||||
@@ -117,10 +117,11 @@ class MLFlow(BaseActivity):
|
||||
|
||||
# Request transformation from MLFlow model
|
||||
response_data = self.model_monitoring_repository.transform(
|
||||
model_name, data, model_retention)
|
||||
model_name, data, model_config
|
||||
)
|
||||
|
||||
self.debug("Transform response data:", metadata)
|
||||
self.debug(json.dumps(response_data, indent=4), metadata)
|
||||
self.debug(response_data, metadata)
|
||||
|
||||
self.info("Data transformed successfully", metadata)
|
||||
|
||||
@@ -160,7 +161,7 @@ class MLFlow(BaseActivity):
|
||||
self.info('Predicting data...', metadata)
|
||||
data = DataFrame(input_data['data'])
|
||||
model_name = input_data['model_name']
|
||||
model_retention = input_data['model_retention']
|
||||
model_config = input_data.get('model_config', {})
|
||||
|
||||
self.debug(data, metadata)
|
||||
|
||||
@@ -169,7 +170,8 @@ class MLFlow(BaseActivity):
|
||||
|
||||
# Request prediction from MLFlow model
|
||||
response_data = self.model_monitoring_repository.predict(
|
||||
model_name, data, model_retention)
|
||||
model_name, data, model_config
|
||||
)
|
||||
|
||||
self.debug("Prediction response data:", metadata)
|
||||
self.debug(json.dumps(response_data, indent=4), metadata)
|
||||
|
||||
Reference in New Issue
Block a user