You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/openai/how-to/integrate-synapseml.md
+46-27Lines changed: 46 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Azure OpenAI can be used to solve a large number of natural language tasks throu
25
25
- An Azure OpenAI resource. [Create a resource](create-resource.md?pivots=web-portal#create-a-resource).
26
26
- An Apache Spark cluster with SynapseML installed.
27
27
- Create a [serverless Apache Spark pool](../../../synapse-analytics/get-started-analyze-spark.md#create-a-serverless-apache-spark-pool).
28
-
- To install SynapseML for your Apache Spark cluster, see [Install SynapseML](#install-synapseml).
28
+
- To install SynapseML for your Apache Spark cluster, see [Install SynapseML](#step-3-install-synapseml).
29
29
30
30
> [!NOTE]
31
31
> Currently, you must submit an application to access Azure OpenAI Service. To apply for access, complete <ahref="https://aka.ms/oai/access"target="_blank">this form</a>. If you need assistance, open an issue on this repo to contact Microsoft.
@@ -59,29 +59,48 @@ When you have a notebook ready, connect or _attach_ your notebook to an Apache S
59
59
60
60
### Step 3: Install SynapseML
61
61
62
-
To run the exercises, you need to install SynapseML on your Apache Spark cluster. You complete this task in a code cell at the top of your notebook. For more information about the installation process, see the link for Azure Synapse at the bottom of [the SynapseML website](https://microsoft.github.io/SynapseML/).
63
-
64
-
To install SynapseML, create a new cell at the top of your notebook and run the following code:
To run the exercises, you need to install SynapseML on your Apache Spark cluster. For more information about the installation process, see the link for Azure Synapse at the bottom of [the SynapseML website](https://microsoft.github.io/SynapseML/).
63
+
64
+
To install SynapseML, create a new cell at the top of your notebook and run the following code.
65
+
66
+
- For a **Spark3.2 pool**, use the following code:
After the top cell in your notebook, add a new cell to configure the notebook for your service by running the following code. Set the `resource_name`, `deployment_name`, `location`, and `key` variables to the corresponding values for your Azure OpenAI resource.
103
+
Create a new code cell and run the following code to configure the notebook for your service. Set the `resource_name`, `deployment_name`, `location`, and `key` variables to the corresponding values for your Azure OpenAI resource.
85
104
86
105
```python
87
106
import os
@@ -103,7 +122,7 @@ Now you're ready to start running the example code.
103
122
104
123
## Create a dataset of prompts
105
124
106
-
The next step is to create a dataframe consisting of a series of rows, with one prompt per row.
125
+
The first step is to create a dataframe consisting of a series of rows, with one prompt per row.
107
126
108
127
You can also load data directly from Azure Data Lake Storage or other databases. For more information about loading and preparing Spark dataframes, see the [Apache Spark Data Sources](https://spark.apache.org/docs/latest/sql-data-sources.html).
The following image shows example output with completions for the transformed dataframe in Azure Synapse Analytics Studio. Keep in mind that completions text can vary so your output might look different.
170
+
The following image shows example output with completions in Azure Synapse Analytics Studio. Keep in mind that completions text can vary so your output might look different.
152
171
153
-
:::image type="content" source="../media/how-to/synapse-studio-transform-dataframe-output.png" alt-text="Screenshot that shows sample completions for the transformed dataframe in Azure Synapse Analytics Studio." border="false":::
172
+
:::image type="content" source="../media/how-to/synapse-studio-transform-dataframe-output.png" alt-text="Screenshot that shows sample completions in Azure Synapse Analytics Studio." border="false":::
The following image shows example output with completions for multiple prompts in a batch prompt request:
218
+
The following image shows example output with completions for multiple prompts in a request:
200
219
201
-
:::image type="content" source="../media/how-to/synapse-studio-request-batch-output.png" alt-text="Screenshot that shows completions for multiple prompts in a batch prompt request in Azure Synapse Analytics Studio." border="false":::
220
+
:::image type="content" source="../media/how-to/synapse-studio-request-batch-output.png" alt-text="Screenshot that shows completions for multiple prompts in a single request in Azure Synapse Analytics Studio." border="false":::
202
221
203
222
> [!NOTE]
204
223
> There's currently a limit of 20 prompts in a single request and a limit of 2048 "tokens," or approximately 1500 words.
The following image shows example output for an automatic mini-batcher that transposes data to row format:
225
244
226
-
:::image type="content" source="../media/how-to/synapse-studio-transpose-data-output.png" alt-text="Screenshot that shows completions for an automatic mini-batcher that transposes data to row format in Azure Synapse Analytics Studio." border="false":::
245
+
:::image type="content" source="../media/how-to/synapse-studio-transpose-data-output.png" alt-text="Screenshot that shows completions for an automatic mini-batcher in Azure Synapse Analytics Studio." border="false":::
The following image shows example output when you prompt the GPT-3 model to create general-knowledge question answering:
282
+
The following image shows example output for general-knowledge question answering:
264
283
265
-
:::image type="content" source="../media/how-to/synapse-studio-question-answer-output.png" alt-text="Screenshot that shows completions for prompting the GPT-3 model to create general-knowledge question answering in Azure Synapse Analytics Studio." border="false":::
284
+
:::image type="content" source="../media/how-to/synapse-studio-question-answer-output.png" alt-text="Screenshot that shows completions for general-knowledge question answering in Azure Synapse Analytics Studio." border="false":::
0 commit comments