Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Some tidying and build fixes #1984

Merged
merged 5 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .pre-commit-config.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class AnalyzeDocumentSuite extends TransformerFuzzing[AnalyzeDocument] with Form
"Contoso\nAddress:\n1 Redmond way Suite\n6000 Redmond, WA\n99243\n" +
"Invoice For: Microsoft\n1020 Enterprise Way",
"CustomerAddress,CustomerAddressRecipient," +
"CustomerName,DueDate,InvoiceDate,InvoiceId,Items,VendorAddress,VendorName")
"CustomerName,DueDate,InvoiceDate,InvoiceId,InvoiceTotal,Items,VendorAddress,VendorName")
}
}

Expand Down
2 changes: 2 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ dependencies:
- huggingface-hub>=0.8.1
- langchain==0.0.151
- openai==0.27.5
- black==22.3.0
- black[jupyter]==22.3.0
7 changes: 0 additions & 7 deletions hooks/pre-commit

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -517,4 +517,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@
" - If you are running it on Synapse, you'll need to [create an AML workspace and set up linked Service](https://microsoft.github.io/SynapseML/docs/next/mlflow/installation/). \n"
]
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"import subprocess\n",
"import sys\n",
"\n",
"for package in [\"sqlparse\", \"raiwidgets\", \"interpret-community\"]:\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", package])"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -145,27 +163,26 @@
"experiment_name = f\"/Shared/isolation_forest_experiment-{str(uuid.uuid1())}/\"\n",
"model_name = f\"isolation-forest-model\"\n",
"if running_on_synapse():\n",
" import subprocess\n",
" import sys\n",
" from pyspark.sql.functions import udf\n",
" from synapse.ml.core.platform import materializing_display as display\n",
"\n",
" # use regular display when running on interactive notebook\n",
" # from notebookutils.visualization import display\n",
"\n",
" for package in [\"sqlparse\", \"raiwidgets\", \"interpret-community\"]:\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", package])"
" # from notebookutils.visualization import display"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Bootstrap Spark Session\n",
"spark = SparkSession.builder.getOrCreate()"
]
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -564,7 +581,7 @@
"outputs": [],
"source": [
"# Define UDF\n",
"vec2array = udf(lambda vec: vec.toArray().tolist(), ArrayType(FloatType()))"
"vec2array = F.udf(lambda vec: vec.toArray().tolist(), ArrayType(FloatType()))"
]
},
{
Expand Down Expand Up @@ -1013,4 +1030,4 @@
},
"nbformat": 4,
"nbformat_minor": 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"\n",
"if running_on_synapse():\n",
" shell = TerminalInteractiveShell.instance()\n",
" shell.define_macro(\"foo\", \"\"\"a,b=10,20\"\"\")\n",
" from notebookutils.visualization import display\n",
"\n",
"\n",
Expand Down Expand Up @@ -481,4 +480,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
8 changes: 3 additions & 5 deletions pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,10 @@ jobs:
scriptLocation: inlineScript
scriptType: bash
inlineScript: 'sbt scalastyle test:scalastyle'
- task: UsePythonVersion@00
inputs:
versionSpec: '3.8'
- script: pip install -r requirements.txt
displayName: 'Install requirements'
- template: templates/conda.yml
- bash: |
set -e
source activate synapseml
black --diff --color . && black --check -q .
displayName: 'Python Style Check'

Expand Down
7 changes: 0 additions & 7 deletions requirements.txt

This file was deleted.

6 changes: 3 additions & 3 deletions website/docs/documentation/transformers/core/_Train.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ from synapse.ml.train import *
from numpy import random

df = spark.createDataFrame(
[(random.rand(), random.rand()) for _ in range(4096)], ["label", "prediction"]
[(random.rand(), random.rand()) for _ in range(2048)], ["label", "prediction"]
)

cms = (ComputeModelStatistics()
Expand All @@ -43,8 +43,8 @@ import com.microsoft.azure.synapse.ml.train._
import scala.util.Random

val rand = new Random(1337)
val df = (Seq.fill(4096)(rand.nextDouble())
.zip(Seq.fill(4096)(rand.nextDouble()))
val df = (Seq.fill(2048)(rand.nextDouble())
.zip(Seq.fill(2048)(rand.nextDouble()))
.toDF("label", "prediction"))

val cms = (new ComputeModelStatistics()
Expand Down