Skip to content

Commit 5f321d2

Browse files
committed
notebook tweaks
1 parent 7eab0c8 commit 5f321d2

4 files changed

Lines changed: 16 additions & 17 deletions

File tree

docs/notebook_source/1-the-basics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314
#
315315

316316
# %%
317-
results = data_designer.create(config_builder, num_records=10)
317+
results = data_designer.create(config_builder, num_records=10, dataset_name="tutorial-1")
318318

319319
# %%
320320
# Load the generated dataset as a pandas DataFrame.

docs/notebook_source/2-structured-outputs-and-jinja-expressions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
#
5353

5454
# %%
55-
data_designer_client = DataDesigner()
55+
data_designer = DataDesigner()
5656

5757
# %% [markdown]
5858
# ### 🎛️ Define model configurations
@@ -327,7 +327,7 @@ class ProductReview(BaseModel):
327327
#
328328

329329
# %%
330-
preview = data_designer_client.preview(config_builder, num_records=2)
330+
preview = data_designer.preview(config_builder, num_records=2)
331331

332332
# %%
333333
# Run this cell multiple times to cycle through the 2 preview records.
@@ -358,17 +358,17 @@ class ProductReview(BaseModel):
358358
#
359359

360360
# %%
361-
job_results = data_designer_client.create(config_builder, num_records=10)
361+
results = data_designer.create(config_builder, num_records=10, dataset_name="tutorial-2")
362362

363363
# %%
364364
# Load the generated dataset as a pandas DataFrame.
365-
dataset = job_results.load_dataset()
365+
dataset = results.load_dataset()
366366

367367
dataset.head()
368368

369369
# %%
370370
# Load the analysis results into memory.
371-
analysis = job_results.load_analysis()
371+
analysis = results.load_analysis()
372372

373373
analysis.to_report()
374374

docs/notebook_source/3-seeding-with-a-dataset.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
DataDesigner,
3535
DataDesignerConfigBuilder,
3636
ModelConfig,
37-
SeedConfig,
3837
)
3938

4039
# %% [markdown]
@@ -46,7 +45,7 @@
4645
#
4746

4847
# %%
49-
data_designer_client = DataDesigner()
48+
data_designer = DataDesigner()
5049

5150
# %% [markdown]
5251
# ### 🎛️ Define model configurations
@@ -122,12 +121,12 @@
122121
import urllib.request
123122

124123
url = "https://raw.githubusercontent.com/NVIDIA/GenerativeAIExamples/refs/heads/main/nemo/NeMo-Data-Designer/data/gretelai_symptom_to_diagnosis.csv"
125-
local_filename, headers = urllib.request.urlretrieve(url, "gretelai_symptom_to_diagnosis.csv")
124+
local_filename, _ = urllib.request.urlretrieve(url, "gretelai_symptom_to_diagnosis.csv")
126125

127-
seed_dataset = SeedConfig(dataset=local_filename)
126+
# Seed datasets are passed as reference objects to the config builder.
127+
seed_dataset_reference = data_designer.make_seed_reference_from_file(local_filename)
128128

129-
# Pass the reference to the config builder for use during generation.
130-
config_builder.with_seed_dataset(seed_dataset)
129+
config_builder.with_seed_dataset(seed_dataset_reference)
131130

132131
# %% [markdown]
133132
# ## 🎨 Designing our synthetic patient notes dataset
@@ -238,7 +237,7 @@
238237
#
239238

240239
# %%
241-
preview = data_designer_client.preview(config_builder, num_records=2)
240+
preview = data_designer.preview(config_builder, num_records=2)
242241

243242
# %%
244243
# Run this cell multiple times to cycle through the 2 preview records.
@@ -269,17 +268,17 @@
269268
#
270269

271270
# %%
272-
job_results = data_designer_client.create(config_builder, num_records=10)
271+
results = data_designer.create(config_builder, num_records=10, dataset_name="tutorial-3")
273272

274273
# %%
275274
# Load the generated dataset as a pandas DataFrame.
276-
dataset = job_results.load_dataset()
275+
dataset = results.load_dataset()
277276

278277
dataset.head()
279278

280279
# %%
281280
# Load the analysis results into memory.
282-
analysis = job_results.load_analysis()
281+
analysis = results.load_analysis()
283282

284283
analysis.to_report()
285284

docs/notebook_source/4-providing-images-as-context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def convert_image_to_chat_format(record, height: int) -> dict:
286286
#
287287

288288
# %%
289-
results = data_designer.create(config_builder, num_records=10)
289+
results = data_designer.create(config_builder, num_records=10, dataset_name="tutorial-4")
290290

291291
# %%
292292
# Load the generated dataset as a pandas DataFrame.

0 commit comments

Comments
 (0)