nemo-data-designer-plugin
NVIDIA/skills
Создавайте синтетические наборы данных и конвейеры генерации данных с помощью библиотеки Data Designer.
...Расширить всеПрежде чем начать
Не изучайте рабочую область заранее. На этапе «Обучение» рабочего процесса вы найдете всю необходимую информацию.
Цель
Создайте с помощью библиотеки Data Designer синтетический набор данных, соответствующий следующему описанию:
$ARGUMENTS
Рабочий процесс
Используйте режим «Автопилот», если пользователь дает понять, что не хочет отвечать на вопросы — например, говорит что-то вроде «действуйте по своему усмотрению», «решайте сами», «делайте разумные допущения», «просто создайте», «удивите меня» и т. д. В противном случае используйте интерактивный режим (по умолчанию).
Прочитайте только файл рабочего процесса, соответствующий выбранному режиму, а затем следуйте ему:
- Интерактивный → прочитать
workflows/interactive.md - «Автопилот» → прочитать
workflows/autopilot.md
Правила
- По умолчанию сохраняйте все столбцы в выходных данных. Единственными исключениями для удаления столбца являются: (1) пользователь явно просит об этом, или (2) это вспомогательный столбец, существующий исключительно для вывода других столбцов (например, объект «выбранного человека», используемый для извлечения имени, города и т. д.). В случае сомнений сохраняйте столбец.
- Не предлагайте и не спрашивайте о начальных наборах данных. Используйте их только в том случае, если пользователь явно предоставляет исходные данные или просит построить набор на основе существующих записей. При использовании исходных данных ознакомьтесь с
references/seed-datasets.md. - Если набору данных требуются данные о лицах (имена, демографические данные, адреса), ознакомьтесь с
references/person-sampling.md. - Если скрипт набора данных, соответствующий описанию набора данных, уже существует, спросите пользователя, нужно ли его отредактировать или создать новый.
- Что касается команд и контекста, специфичных для данного плагина платформы NeMo (например, получение конфигураций моделей от поставщиков IGW или встроенных в скрипт
ModelConfig, установку или публикацию локалей Nemotron Personas, указатели на ресурсы на стороне платформы), ознакомьтесь сreferences/nemo-platform-plugin-additions.md.
«Советы по использованию и типичные ошибки»
- Колонки выборки и валидации требуют указания как типа, так и параметров. Например,
sampler_type="category"сparams=dd.CategorySamplerParams(...). - шаблонами Jinja2 в
prompt,system_prompt, а такжеexprполя: ссылочные столбцы с{{ column_name }}, вложенные поля с{{ column_name.field }}. **SamplerColumnConfig:** Принимаетparams, а неsampler_params.- доступ к оценкам судей LLM:
LLMJudgeColumnConfigсоздаёт вложенный словарь, в котором каждое название оценки сопоставляется с{reasoning: str, score: int}. Чтобы получить числовую оценку, используйте.scoreатрибут. Например, для столбца оценки судьи с именемqualityс оценкой под названиемcorrectness, используйте{{ quality.correctness.score }}. Использование{{ quality.correctness }}возвращается полный словарь, а не числовой балл.
Устранение неполадок
**nemo data-designerCLI не найден:** Сообщите пользователю, чтоnemo data-designerне установлен в данной среде (требуется Python версии 3.11 или выше). Спросите, хочет ли он, чтобы вы создали виртуальную среду и установили его, или он предпочитает сделать это самостоятельно. Не устанавливайте ничего без разрешения пользователя.- Сетевые ошибки во время предварительного просмотра: среда песочницы может блокировать исходящие запросы. Попросите у пользователя разрешения повторить команду с отключенной песочницей. Только в крайнем случае, если повторная попытка вне песочницы также не удалась, предложите пользователю запустить команду самостоятельно.
Шаблон вывода
Создайте в текущем каталоге файл Python с load_config_builder() функцией, возвращающей DataDesignerConfigBuilder. Назовите файл так, чтобы его название отражало его назначение (например, customer_reviews.py). Используйте встроенные метаданные PEP 723 для указания зависимостей.
# /// script
# dependencies = [
# "data-designer", # always required
# "pydantic", # only if this script imports from pydantic
# # add additional dependencies here
# ]
# ///
import data_designer.config as dd
from pydantic import BaseModel, Field
# Use Pydantic models when the output needs to conform to a specific schema
class MyStructuredOutput(BaseModel):
field_one: str = Field(description="...")
field_two: int = Field(description="...")
# Use custom generators when built-in column types aren't enough
@dd.custom_column_generator(
required_columns=["col_a"],
side_effect_columns=["extra_col"],
)
def generator_function(row: dict) -> dict:
# add custom logic here that depends on "col_a" and update row in place
row["name_in_custom_column_config"] = "custom value"
row["extra_col"] = "extra value"
return row
def load_config_builder() -> dd.DataDesignerConfigBuilder:
config_builder = dd.DataDesignerConfigBuilder(
# Declaring model configs programmatically here is the portable path:
# it works for both local `run` and cluster `submit`, while the local
# YAML registry alternative only works for `run`. The provider below
# is a common default created during `nemo setup` — confirm it (or
# discover others) with `nemo inference providers list`. See
# references/nemo-platform-plugin-additions.md for the local-YAML alternative.
model_configs=[
dd.ModelConfig(
alias="text",
model="...",
provider="default/nvidia-build",
inference_parameters=dd.ChatCompletionInferenceParams(),
),
],
)
# Seed dataset (only if the user explicitly mentions a seed dataset path)
# config_builder.with_seed_dataset(dd.LocalFileSeedSource(path="path/to/seed.parquet"))
# config_builder.add_column(...)
# config_builder.add_processor(...)
return config_builder
Включайте модели Pydantic, пользовательские генераторы, наборы данных seed и дополнительные зависимости только в том случае, если это требуется для решения задачи. Предпочтительно включать model_configs , если в наборе данных используются столбцы LLM — объявление этого в скрипте обеспечивает переносимость конфигурации между локальными run и кластером submit, тогда как альтернативный локальный реестр YAML работает только для run.
---
name: nemo-data-designer-plugin
description: Build synthetic datasets and data generation pipelines using the Data Designer library.
license: Apache-2.0
---
# Before You Start
Do not explore the workspace first. The workflow's Learn step gives you everything you need.
# Goal
Build a synthetic dataset using the Data Designer library that matches this description:
$ARGUMENTS
# Workflow
Use **Autopilot** mode if the user implies they don't want to answer questions — e.g., they say something like "be opinionated", "you decide", "make reasonable assumptions", "just build it", "surprise me", etc. Otherwise, use **Interactive** mode (default).
Read **only** the workflow file that matches the selected mode, then follow it:
- **Interactive** → read `workflows/interactive.md`
- **Autopilot** → read `workflows/autopilot.md`
# Rules
- Keep all columns in the output by default. The only exceptions for dropping a column are: (1) the user explicitly asks, or (2) it is a helper column that exists solely to derive other columns (e.g., a sampled person object used to extract name, city, etc.). When in doubt, keep the column.
- Do not suggest or ask about seed datasets. Only use one when the user explicitly provides seed data or asks to build from existing records. When using a seed, read `references/seed-datasets.md`.
- When the dataset requires person data (names, demographics, addresses), read `references/person-sampling.md`.
- If a dataset script that matches the dataset description already exists, ask the user whether to edit it or create a new one.
- For commands and context specific to this NeMo Platform plugin (e.g., sourcing model configs from IGW providers or in-script `ModelConfig`s, installing or publishing Nemotron Personas locales, platform-side resource pointers), read `references/nemo-platform-plugin-additions.md`.
# Usage Tips and Common Pitfalls
- **Sampler and validation columns need both a type and params.** E.g., `sampler_type="category"` with `params=dd.CategorySamplerParams(...)`.
- **Jinja2 templates** in `prompt`, `system_prompt`, and `expr` fields: reference columns with `{{ column_name }}`, nested fields with `{{ column_name.field }}`.
- `**SamplerColumnConfig`:** Takes `params`, not `sampler_params`.
- **LLM judge score access:** `LLMJudgeColumnConfig` produces a nested dict where each score name maps to `{reasoning: str, score: int}`. To get the numeric score, use the `.score` attribute. For example, for a judge column named `quality` with a score named `correctness`, use `{{ quality.correctness.score }}`. Using `{{ quality.correctness }}` returns the full dict, not the numeric score.
# Troubleshooting
- `**nemo data-designer` CLI not found:** Tell the user that `nemo data-designer` is not installed in this environment (requires Python >= 3.11). Ask if they would like you to create a virtual environment and install it, or if they prefer to do it themselves. Do not install anything without the user's permission.
- **Network errors during preview:** A sandbox environment may be blocking outbound requests. Ask the user for permission to retry the command with the sandbox disabled. Only as a last resort, if retrying outside the sandbox also fails, tell the user to run the command themselves.
# Output Template
Write a Python file to the current directory with a `load_config_builder()` function returning a `DataDesignerConfigBuilder`. Name the file descriptively (e.g., `customer_reviews.py`). Use PEP 723 inline metadata for dependencies.
```python
# /// script
# dependencies = [
# "data-designer", # always required
# "pydantic", # only if this script imports from pydantic
# # add additional dependencies here
# ]
# ///
import data_designer.config as dd
from pydantic import BaseModel, Field
# Use Pydantic models when the output needs to conform to a specific schema
class MyStructuredOutput(BaseModel):
field_one: str = Field(description="...")
field_two: int = Field(description="...")
# Use custom generators when built-in column types aren't enough
@dd.custom_column_generator(
required_columns=["col_a"],
side_effect_columns=["extra_col"],
)
def generator_function(row: dict) -> dict:
# add custom logic here that depends on "col_a" and update row in place
row["name_in_custom_column_config"] = "custom value"
row["extra_col"] = "extra value"
return row
def load_config_builder() -> dd.DataDesignerConfigBuilder:
config_builder = dd.DataDesignerConfigBuilder(
# Declaring model configs programmatically here is the portable path:
# it works for both local `run` and cluster `submit`, while the local
# YAML registry alternative only works for `run`. The provider below
# is a common default created during `nemo setup` — confirm it (or
# discover others) with `nemo inference providers list`. See
# references/nemo-platform-plugin-additions.md for the local-YAML alternative.
model_configs=[
dd.ModelConfig(
alias="text",
model="...",
provider="default/nvidia-build",
inference_parameters=dd.ChatCompletionInferenceParams(),
),
],
)
# Seed dataset (only if the user explicitly mentions a seed dataset path)
# config_builder.with_seed_dataset(dd.LocalFileSeedSource(path="path/to/seed.parquet"))
# config_builder.add_column(...)
# config_builder.add_processor(...)
return config_builder
```
Only include Pydantic models, custom generators, seed datasets, and extra dependencies when the task requires them. Prefer including `model_configs` when the dataset uses LLM columns — declaring it in the script keeps the config portable between local `run` and cluster `submit`, while the local YAML registry alternative only works for `run`.
Все файлы
12 файловУстановить nemo-data-designer-plugin
Скачайте файлы навыков и распакуйте их в каталог .claude/skills/.
Скачать ZIPКлонируйте репозиторий и скопируйте файлы навыка в свой проект.
git clone https://github.com/NVIDIA/skills/tree/main/skills/nemo-data-designer-plugin # Copy SKILL.md to your .claude/skills/ directory
Копировать





Дом
