> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/curator/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/curator/_mcp/server.

# nemo_curator.stages.audio.io.convert

## Module Contents

### Classes

| Name                                                                                 | Description                                              |
| ------------------------------------------------------------------------------------ | -------------------------------------------------------- |
| [`AudioToDocumentStage`](#nemo_curator-stages-audio-io-convert-AudioToDocumentStage) | Convert AudioTask entries into DocumentBatch DataFrames. |

### Functions

| Name                                                             | Description                                                                 |
| ---------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [`_is_tensor`](#nemo_curator-stages-audio-io-convert-_is_tensor) | Check if a value is a torch.Tensor without importing torch at module level. |

### Data

[`_NON_SERIALIZABLE_KEYS`](#nemo_curator-stages-audio-io-convert-_NON_SERIALIZABLE_KEYS)

### API

```python
class nemo_curator.stages.audio.io.convert.AudioToDocumentStage()
```

**Bases:** [ProcessingStage\[AudioTask, DocumentBatch\]](/nemo-curator/nemo_curator/stages/base#nemo_curator-stages-base-ProcessingStage)

Convert AudioTask entries into DocumentBatch DataFrames.

Overrides `process_batch` to aggregate an entire batch of
`AudioTask` objects into a single multi-row `DocumentBatch`,
avoiding the overhead of many single-row DataFrames.  Set
`batch_size` to control how many audio entries land in each
DataFrame (default 64).

Non-serializable keys (torch tensors, raw audio arrays) are
stripped before building the DataFrame as a safety net, even if
upstream stages failed to clean them up.

**`batch_size`** `int = 64`

---

**`name`** `= 'AudioToDocumentStage'`

---

```python
nemo_curator.stages.audio.io.convert.AudioToDocumentStage._sanitize(
    data: dict
) -> dict
```

staticmethod

Remove non-serializable keys and any remaining tensor values.

```python
nemo_curator.stages.audio.io.convert.AudioToDocumentStage.process(
    task: nemo_curator.tasks.AudioTask
) -> nemo_curator.tasks.DocumentBatch
```

```python
nemo_curator.stages.audio.io.convert.AudioToDocumentStage.process_batch(
    tasks: list[nemo_curator.tasks.AudioTask]
) -> list[nemo_curator.tasks.DocumentBatch]
```

```python
nemo_curator.stages.audio.io.convert._is_tensor(
    v: object
) -> bool
```

Check if a value is a torch.Tensor without importing torch at module level.

```python
nemo_curator.stages.audio.io.convert._NON_SERIALIZABLE_KEYS = frozenset({'waveform', 'audio', 'audio_data', 'audio_array', 'segments'})
```