This guide provides step-by-step instructions for training the Vishwamai models of sizes 2b, 7b, 9b, and 27b. Follow these steps to set up the training environment, execute the training process, and upload the trained models to Hugging Face.
- Ensure you have Python 3.8 or later installed.
- Install the required dependencies listed in the
requirements.txt
file:pip install -r requirements.txt
The configuration files for the Vishwamai models are located in the chat-agent
directory:
config_for_2b.yaml
config_for_7b.yaml
config_for_9b.yaml
config_for_27b.yaml
Update the train_dataset
and validation_dataset
paths in each configuration file with the actual locations of your datasets.
Use the train_and_upload_models.sh
script to train the models and upload them to Hugging Face. The script includes error handling for various steps in the training and uploading process.
- Open the
train_and_upload_models.sh
script and review the commands. - Execute the script to start the training process:
./train_and_upload_models.sh
The train_and_upload_models.sh
script performs the following steps:
- Sets up the training environment.
- Trains the Vishwamai models using the specified configuration files.
- Evaluates the models using the specified metrics (Perplexity, BLEU, ROUGE).
- Uploads the trained models to Hugging Face.
After training, the models will be uploaded to the Hugging Face repository. Ensure you have the necessary authentication tokens and permissions to upload the models.
Set up your Hugging Face authentication token:
- Create a
.huggingface
directory in your home directory:mkdir -p ~/.huggingface
- Create a
token
file in the.huggingface
directory and add your Hugging Face token:echo "your_huggingface_token" > ~/.huggingface/token
The train_and_upload_models.sh
script includes commands to upload the trained models to Hugging Face. Ensure the script runs successfully to complete the upload process.
By following this guide, you will be able to train the Vishwamai models of sizes 2b, 7b, 9b, and 27b and upload them to Hugging Face. Ensure all configuration files are updated with the correct dataset paths and that you have the necessary authentication tokens for Hugging Face.
For any issues or further assistance, refer to the documentation or contact the support team.