Passer à la navigation

nemo_rl.models.megatron.community_import

Afficher en Markdown

Contenu du module

Fonctions

NomDescription
import_model_from_hf_nameImporter 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_megatronAucun

API

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é.

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
)