Downloads · 30 days
0
nanotron/mistral-nanotron
mistral-nanotron is a machine learning model from nanotron. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for nanotron.
Modeling code for Mistral to use with Nanotron
Downloads · 30 days
0
Access
Public
Updated Feb 9, 2024
Repo size
14.5 GB
Likes
1
Public
Click a slice to open those files.
.safetensors14.5 GB · 100%
From the Hugging Face model README
Modeling code for Mistral to use with Nanotron
Also contains converted pretrained weights for Mistral-7B-0.1: https://huggingface.co/mistralai/Mistral-7B-v0.1
# Generate a config file
python config_tiny_mistral.py
# Run training
export CUDA_DEVICE_MAX_CONNECTIONS=1 # important for some distributed operations
torchrun --nproc_per_node=8 run_train.py --config-file config_tiny_mistral.yaml
export CUDA_DEVICE_MAX_CONNECTIONS=1
torchrun --nproc_per_node=1 run_generate.py --ckpt-path ./pretrained/Mistral-7B-v0.1
MistralConfig class in config_tiny_mistral.py to match your model's configurationMistralForTraining class in modeling_mistral.py to match your model's architectureDistributedTrainer class in run_train.py:trainer = DistributedTrainer(config_file, model_class=MistralForTraining, model_config_class=MistralConfig)