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

# nemo\_rl.models.megatron.community\_import

## Contenu du module

### Fonctions

| Nom                                                                                         | Description                                                                                                                                         |
| ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`import_model_from_hf_name`](#nemorlmodelsmegatroncommunityimportimportmodelfromhfname)    | Importer un modèle Hugging Face dans le format de point de contrôle Megatron et enregistrer le point de contrôle Megatron dans le chemin de sortie. |
| [`export_model_from_megatron`](#nemorlmodelsmegatroncommunityimportexportmodelfrommegatron) | Aucun                                                                                                                                               |

### API

```python
nemo_rl.models.megatron.community_import.import_model_from_hf_name(
    hf_model_name: str,
    output_path: str,
    megatron_config: typing.Optional[nemo_rl.models.policy.MegatronConfig] = None
)
```

Importer un modèle Hugging Face dans le format de point de contrôle Megatron et enregistrer le point de contrôle Megatron dans le chemin de sortie.

Arguments :
hf\_model\_name : Identifiant de modèle Hugging Face ou chemin local (par exemple, 'meta-llama/Llama-3.1-8B-Instruct').
output\_path : Répertoire pour écrire le point de contrôle Megatron (par exemple, /tmp/megatron\_ckpt).
megatron\_config : Configuration Megatron optionnelle avec des paramètres de parallélisme pour l'importation de modèle Megatron distribué.

```python
nemo_rl.models.megatron.community_import.export_model_from_megatron(
    hf_model_name: str,
    input_path: str,
    output_path: str,
    hf_tokenizer_path: str,
    overwrite: bool = False
)
```