-
Notifications
You must be signed in to change notification settings - Fork 834
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: pin binder version for users (#1607)
* chore: pin binder compatible version * fix dbfs/databricks case escapes in notebooks Co-authored-by: Puneet Pruthi <[email protected]>
- Loading branch information
Showing
9 changed files
with
45 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ | |
"# Bootstrap Spark Session\n", | ||
"spark = SparkSession.builder.getOrCreate()\n", | ||
"\n", | ||
"from synapse.ml.core.platform import running_on_synapse\n", | ||
"from synapse.ml.core.platform import running_on_synapse, running_on_databricks\n", | ||
"\n", | ||
"if running_on_synapse():\n", | ||
" from notebookutils.visualization import display" | ||
|
@@ -71,9 +71,12 @@ | |
"if running_on_synapse():\n", | ||
" modelDir = \"abfss://[email protected]/models/\"\n", | ||
" dataDir = \"./nltkdata\"\n", | ||
"else:\n", | ||
"elif running_on_databricks():\n", | ||
" modelDir = \"dbfs:/models/\"\n", | ||
" dataDir = \"/dbfs/nltkdata\"\n", | ||
"else:\n", | ||
" modelDir = \"/tmp/models/\"\n", | ||
" dataDir = \"/tmp/nltkdata\"\n", | ||
"\n", | ||
"d = ModelDownloader(spark, modelDir)\n", | ||
"modelSchema = d.downloadByName(modelName)\n", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
"# Bootstrap Spark Session\n", | ||
"spark = SparkSession.builder.getOrCreate()\n", | ||
"\n", | ||
"from synapse.ml.core.platform import running_on_synapse\n", | ||
"from synapse.ml.core.platform import running_on_synapse, running_on_databricks\n", | ||
"\n", | ||
"if running_on_synapse():\n", | ||
" from notebookutils.visualization import display" | ||
|
@@ -63,8 +63,10 @@ | |
"modelName = \"ConvNet\"\n", | ||
"if running_on_synapse():\n", | ||
" modelDir = \"abfss://[email protected]/models/\"\n", | ||
"elif running_on_databricks():\n", | ||
" modelDir = \"dbfs:/models/\"\n", | ||
"else:\n", | ||
" modelDir = \"dbfs:/models/\"" | ||
" modelDir = \"/tmp/models/\"" | ||
] | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
"# Bootstrap Spark Session\n", | ||
"spark = SparkSession.builder.getOrCreate()\n", | ||
"\n", | ||
"from synapse.ml.core.platform import running_on_synapse\n", | ||
"from synapse.ml.core.platform import running_on_synapse, running_on_databricks\n", | ||
"\n", | ||
"if running_on_synapse():\n", | ||
" from notebookutils.visualization import display" | ||
|
@@ -38,8 +38,10 @@ | |
"source": [ | ||
"if running_on_synapse():\n", | ||
" modelDir = \"abfss://[email protected]/models/\"\n", | ||
"else:\n", | ||
"elif running_on_databricks():\n", | ||
" modelDir = \"dbfs:/models/\"\n", | ||
"else:\n", | ||
" modelDir = \"/tmp/models/\"\n", | ||
"\n", | ||
"model = ModelDownloader(spark, modelDir).downloadByName(\"ResNet50\")" | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,13 +35,15 @@ | |
"# Bootstrap Spark Session\n", | ||
"spark = SparkSession.builder.getOrCreate()\n", | ||
"\n", | ||
"from synapse.ml.core.platform import running_on_synapse\n", | ||
"from synapse.ml.core.platform import running_on_synapse, running_on_databricks\n", | ||
"\n", | ||
"modelName = \"ConvNet\"\n", | ||
"if running_on_synapse():\n", | ||
" modelDir = \"abfss://[email protected]/models/\"\n", | ||
"else:\n", | ||
"elif running_on_databricks():\n", | ||
" modelDir = \"dbfs:/models/\"\n", | ||
"else:\n", | ||
" modelDir = \"/tmp/models/\"\n", | ||
"\n", | ||
"d = ModelDownloader(spark, modelDir)\n", | ||
"model = d.downloadByName(modelName)\n", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
"source": [ | ||
"import os\n", | ||
"from pyspark.sql import SparkSession\n", | ||
"from synapse.ml.core.platform import running_on_synapse, find_secret\n", | ||
"from synapse.ml.core.platform import *\n", | ||
"\n", | ||
"# Bootstrap Spark Session\n", | ||
"spark = SparkSession.builder.getOrCreate()\n", | ||
|
@@ -133,7 +133,12 @@ | |
" header, tableHTML\n", | ||
" )\n", | ||
" try:\n", | ||
" displayHTML(style + body)\n", | ||
" if running_on_databricks():\n", | ||
" displayHTML(style + body)\n", | ||
" else:\n", | ||
" import IPython\n", | ||
"\n", | ||
" IPython.display.HTML(style + body)\n", | ||
" except:\n", | ||
" pass" | ||
], | ||
|
@@ -232,8 +237,10 @@ | |
" network = ModelDownloader(\n", | ||
" spark, \"abfss://[email protected]/models/\"\n", | ||
" ).downloadByName(\"ResNet50\")\n", | ||
"else:\n", | ||
"elif running_on_databricks():\n", | ||
" network = ModelDownloader(spark, \"dbfs:/Models/\").downloadByName(\"ResNet50\")\n", | ||
"else:\n", | ||
" network = ModelDownloader(spark, \"/tmp/Models/\").downloadByName(\"ResNet50\")\n", | ||
"\n", | ||
"model = Pipeline(\n", | ||
" stages=[\n", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters