Skip to content

Commit fe694ba

Browse files
authored
Merge pull request #392 from mckornfield/move-urls-to-top-nss/mck
chore(safe-synthesizer): move URLs to top, update job builder
2 parents 1fc0290 + 2dc0c10 commit fe694ba

File tree

4 files changed

+310
-273
lines changed

4 files changed

+310
-273
lines changed

nemo/NeMo-Safe-Synthesizer/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# NeMo Safe Synthesizer Example Notebooks
2-
1+
# NeMo Safe Synthesizer Example Notebooks
32

43
This directory contains the tutorial notebooks for getting started with NeMo Safe Synthesizer.
54

@@ -12,17 +11,15 @@ Install the sdk as follows:
1211
```bash
1312
uv venv
1413
source .venv/bin/activate
15-
uv pip install nemo-microservices[safe-synthesizer]
14+
uv pip install nemo-microservices[safe-synthesizer] rich
1615
```
1716

18-
1917
Be sure to select this virtual environment as your kernel when running the notebooks.
2018

2119
## 🚀 Deploying the NeMo Safe Synthesizer Microservice
2220

2321
To run these notebooks, you'll need access to a deployment of the NeMo Safe Synthesizer microservice. You have two deployment options:
2422

25-
2623
### 🐳 Deploy the NeMo Safe Synthesizer Microservice Locally
2724

2825
Follow our quickstart guide to deploy the NeMo safe synthesizer microservice locally via Docker Compose.

nemo/NeMo-Safe-Synthesizer/advanced/advanced_privacy.ipynb

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@
1919
"- **Access an evaluation report** on the quality and privacy of the synthetic data"
2020
]
2121
},
22-
{
23-
"cell_type": "code",
24-
"execution_count": null,
25-
"id": "a538526a",
26-
"metadata": {},
27-
"outputs": [],
28-
"source": []
29-
},
3022
{
3123
"cell_type": "markdown",
3224
"id": "8be84f5d",
@@ -37,6 +29,22 @@
3729
"Ensure you have a NeMo Microservices Platform deployment available. If you're using a managed or remote deployment, have the correct base URLs and tokens ready."
3830
]
3931
},
32+
{
33+
"cell_type": "code",
34+
"execution_count": null,
35+
"id": "a538526a",
36+
"metadata": {
37+
"tags": [
38+
"parameters"
39+
]
40+
},
41+
"outputs": [],
42+
"source": [
43+
"# Update as appropriate to your installation URLs\n",
44+
"base_url = \"http://localhost:8080\"\n",
45+
"datastore_endpoint = \"http://localhost:3000/v1/hf\""
46+
]
47+
},
4048
{
4149
"cell_type": "code",
4250
"execution_count": null,
@@ -46,7 +54,7 @@
4654
"source": [
4755
"import pandas as pd\n",
4856
"from nemo_microservices import NeMoMicroservices\n",
49-
"from nemo_microservices.beta.safe_synthesizer.builder import SafeSynthesizerBuilder\n",
57+
"from nemo_microservices.beta.safe_synthesizer.sdk.job_builder import SafeSynthesizerJobBuilder\n",
5058
"\n",
5159
"import logging\n",
5260
"\n",
@@ -74,7 +82,7 @@
7482
"outputs": [],
7583
"source": [
7684
"client = NeMoMicroservices(\n",
77-
" base_url=\"http://localhost:8080\",\n",
85+
" base_url=base_url\n",
7886
")"
7987
]
8088
},
@@ -94,7 +102,7 @@
94102
"outputs": [],
95103
"source": [
96104
"datastore_config = {\n",
97-
" \"endpoint\": \"http://localhost:3000/v1/hf\",\n",
105+
" \"endpoint\": datastore_endpoint\n",
98106
"}"
99107
]
100108
},
@@ -155,7 +163,7 @@
155163
"source": [
156164
"## 🏗️ Create a Safe Synthesizer job\n",
157165
"\n",
158-
"The `SafeSynthesizerBuilder` provides a fluent interface to configure and submit jobs.\n",
166+
"The `SafeSynthesizerJobBuilder` provides a fluent interface to configure and submit jobs.\n",
159167
"\n",
160168
"This job will:\n",
161169
"- Initialize the builder with the NeMo Microservices client.\n",
@@ -175,8 +183,8 @@
175183
"outputs": [],
176184
"source": [
177185
"job = (\n",
178-
" SafeSynthesizerBuilder(client)\n",
179-
" .from_data_source(df)\n",
186+
" SafeSynthesizerJobBuilder(client)\n",
187+
" .with_data_source(df)\n",
180188
" .with_datastore(datastore_config)\n",
181189
" .with_replace_pii()\n",
182190
" .with_differential_privacy(dp_enabled=True, epsilon=8.0)\n",

0 commit comments

Comments
 (0)