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

# nemo_gym.hf_utils

## Module Contents

### Functions

| Name                                                                              | Description                                                |
| --------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [`check_jsonl_format`](#nemo_gym-hf_utils-check_jsonl_format)                     | Check for the presence of the expected keys in the dataset |
| [`create_huggingface_client`](#nemo_gym-hf_utils-create_huggingface_client)       | -                                                          |
| [`download_hf_dataset_as_jsonl`](#nemo_gym-hf_utils-download_hf_dataset_as_jsonl) | Download a HF dataset and save as JSONL.                   |
| [`upload_jsonl_dataset`](#nemo_gym-hf_utils-upload_jsonl_dataset)                 | -                                                          |

### API

```python
nemo_gym.hf_utils.check_jsonl_format(
    file_path: str
) -> bool
```

Check for the presence of the expected keys in the dataset

```python
nemo_gym.hf_utils.create_huggingface_client(
    token: str
) -> huggingface_hub.HfApi
```

```python
nemo_gym.hf_utils.download_hf_dataset_as_jsonl(
    config: nemo_gym.config_types.DownloadJsonlDatasetHuggingFaceConfig
) -> None
```

Download a HF dataset and save as JSONL.
If `artifact_fpath` is provided, downloads that specific file using `hf_hub_download`.
Otherwise, uses datasets.load\_dataset() to handle structured datasets.

```python
nemo_gym.hf_utils.upload_jsonl_dataset(
    config: nemo_gym.config_types.UploadJsonlDatasetHuggingFaceConfig
) -> None
```