Skip to content

Commit fe53d33

Browse files
author
David Thrower
committed
Fix start_run to work in an env that it can't set env variables.
1 parent 24a2b2d commit fe53d33

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

train_a_generative_llm_docker.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,14 @@
560560
train_data_dtype=tf.int32,
561561
merging_strategy='concatenate') # "mhc")
562562

563-
with mlflow.start_run():
563+
experiment = mlflow.get_experiment_by_name(MLFLOW_EXPERIMENT_NAME)
564+
if experiment:
565+
experiment_id = experiment.experiment_id
566+
else:
567+
# Handle the case where the experiment doesn't exist, e.g., create it
568+
experiment_id = mlflow.create_experiment(MLFLOW_EXPERIMENT_NAME)
569+
570+
with mlflow.start_run(experiment_id=experiment_id):
564571
mlflow.log_params(PARAMS)
565572
cerebros_t0 = time.time()
566573
phase_i_a_result_0 = cerebros_automl.run_random_search()

0 commit comments

Comments
 (0)