Skip to content
Open
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
7 changes: 2 additions & 5 deletions nemo/NeMo-Safe-Synthesizer/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# NeMo Safe Synthesizer Example Notebooks

# NeMo Safe Synthesizer Example Notebooks

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

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


Be sure to select this virtual environment as your kernel when running the notebooks.

## 🚀 Deploying the NeMo Safe Synthesizer Microservice

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


### 🐳 Deploy the NeMo Safe Synthesizer Microservice Locally

Follow our quickstart guide to deploy the NeMo safe synthesizer microservice locally via Docker Compose.
Expand Down
36 changes: 22 additions & 14 deletions nemo/NeMo-Safe-Synthesizer/advanced/advanced_privacy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@
"- **Access an evaluation report** on the quality and privacy of the synthetic data"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a538526a",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "8be84f5d",
Expand All @@ -37,6 +29,22 @@
"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."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a538526a",
"metadata": {
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
"# Update as appropriate to your installation URLs\n",
"base_url = \"http://localhost:8080\"\n",
"datastore_endpoint = \"http://localhost:3000/v1/hf\""
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -46,7 +54,7 @@
"source": [
"import pandas as pd\n",
"from nemo_microservices import NeMoMicroservices\n",
"from nemo_microservices.beta.safe_synthesizer.builder import SafeSynthesizerBuilder\n",
"from nemo_microservices.beta.safe_synthesizer.sdk.job_builder import SafeSynthesizerJobBuilder\n",
"\n",
"import logging\n",
"\n",
Expand Down Expand Up @@ -74,7 +82,7 @@
"outputs": [],
"source": [
"client = NeMoMicroservices(\n",
" base_url=\"http://localhost:8080\",\n",
" base_url=base_url\n",
")"
]
},
Expand All @@ -94,7 +102,7 @@
"outputs": [],
"source": [
"datastore_config = {\n",
" \"endpoint\": \"http://localhost:3000/v1/hf\",\n",
" \"endpoint\": datastore_endpoint\n",
"}"
]
},
Expand Down Expand Up @@ -155,7 +163,7 @@
"source": [
"## 🏗️ Create a Safe Synthesizer job\n",
"\n",
"The `SafeSynthesizerBuilder` provides a fluent interface to configure and submit jobs.\n",
"The `SafeSynthesizerJobBuilder` provides a fluent interface to configure and submit jobs.\n",
"\n",
"This job will:\n",
"- Initialize the builder with the NeMo Microservices client.\n",
Expand All @@ -175,8 +183,8 @@
"outputs": [],
"source": [
"job = (\n",
" SafeSynthesizerBuilder(client)\n",
" .from_data_source(df)\n",
" SafeSynthesizerJobBuilder(client)\n",
" .with_data_source(df)\n",
" .with_datastore(datastore_config)\n",
" .with_replace_pii()\n",
" .with_differential_privacy(dp_enabled=True, epsilon=8.0)\n",
Expand Down
Loading