Commit 5b8a9cb1 authored by dasharatha.vamshi's avatar dasharatha.vamshi

added check for parent run

parent f158c0c2
...@@ -5,7 +5,7 @@ from mlflow_util import ModelReTrainer ...@@ -5,7 +5,7 @@ from mlflow_util import ModelReTrainer
if __name__ == "__main__": if __name__ == "__main__":
df = pd.read_csv('mlflow-test.csv') df = pd.read_csv('mlflow-test.csv')
feature = 'instantaneous_export' feature = 'instantaneous_export'
exp_name = 'Dalmia Solar Forecasting V2' exp_name = 'Dalmia Solar Forecasting V3'
parent_run_name = 'Forecasting_kadapa_v1' parent_run_name = 'Forecasting_kadapa_v1'
model_name = 'versioning' model_name = 'versioning'
obj = ModelReTrainer(df, feature, exp_name, parent_run_name, model_name) obj = ModelReTrainer(df, feature, exp_name, parent_run_name, model_name)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -129,7 +129,11 @@ class ModelReTrainer: ...@@ -129,7 +129,11 @@ class ModelReTrainer:
:return: returns the parent run id :return: returns the parent run id
""" """
parent_runs_df = mlflow.search_runs(experiment_id) parent_runs_df = mlflow.search_runs(experiment_id)
parent_runs_df = parent_runs_df[parent_runs_df['tags.mlflow.runName'] == self.parent_run_name] run_key = 'tags.mlflow.runName'
if run_key in parent_runs_df.columns:
parent_runs_df = parent_runs_df[parent_runs_df[run_key] == self.parent_run_name]
else:
parent_runs_df = parent_runs_df.iloc[:0]
if not parent_runs_df.empty: if not parent_runs_df.empty:
logger.info(f"Proceeding with existing Parent Run {self.parent_run_name}") logger.info(f"Proceeding with existing Parent Run {self.parent_run_name}")
return list(parent_runs_df['run_id'])[0] return list(parent_runs_df['run_id'])[0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment