-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathImport_Run.py
More file actions
52 lines (35 loc) · 1.26 KB
/
Copy pathImport_Run.py
File metadata and controls
52 lines (35 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Databricks notebook source
# MAGIC %md ## Import Run
# MAGIC
# MAGIC Import run from folder that was created by [Export_Run]($Export_Run) notebook.
# MAGIC
# MAGIC #### Widgets
# MAGIC * Destination experiment name - Import run into this experiment. Will create if it doesn't exist.
# MAGIC * Input folder - Input directory containing an exported run.
# MAGIC
# MAGIC #### Setup
# MAGIC * See Setup in [README]($00_README_Export_Import).
# COMMAND ----------
# MAGIC %md ### Setup
# COMMAND ----------
dbutils.widgets.text("Destination experiment name", "")
experiment_name = dbutils.widgets.get("Destination experiment name")
dbutils.widgets.text("Input folder", "")
input_dir = dbutils.widgets.get("Input folder")
if len(input_dir)==0: raise Exception("ERROR: Input is required")
input_dir, experiment_name
print("input_dir:",input_dir)
print("experiment_name:",experiment_name)
# COMMAND ----------
# MAGIC %md ### Import Run
# COMMAND ----------
from mlflow_export_import.run.import_run import RunImporter
importer = RunImporter()
run, _ = importer.import_run(experiment_name, input_dir)
run.info.run_id
# COMMAND ----------
# MAGIC %md ### Display MLflow UI URIs
# COMMAND ----------
# MAGIC %run ./Common
# COMMAND ----------
display_run_uri(run.info.run_id)