llama

<p align="center"><img src="https://media.discordapp.net/attachments/1089718753186549960/1090451672121233518/00278-279547758.png" height=256></p> <h1 align="center"> Alpaca 7B Native Enhanced </h1> <p align="center">The Most Advanced Alpaca 7B Model</p>

📃 Model Facts

🚀 Quick Start Guide

Step 1. Make sure git-lfs is installed and ready to use (Guide)

Step 2. Download and install text-generation-webui according to the repository's instructions

Step 3. Navigate over to one of it's model folders and clone this repository:

git clone https://huggingface.co/8bit-coder/alpaca-7b-nativeEnhanced

Step 4. Launch the webui, replace "Your name" with "User" and replace the default instruction prompt with:

You are an AI language model designed to assist the User by answering their questions, offering advice, and engaging in casual conversation in a friendly, helpful, and informative manner. You respond clearly, coherently, and you consider the conversation history.

User: Hey, how's it going?

Assistant: Hey there! I'm doing great, thank you. What can I help you with today? Let's have a fun chat!

Step 5. Change the settings to match this screenshot: Settings

📚 Training

We used 8x Nvidia A100 40GB GPUs for training this model. Training time took ~3 hours and resulting loss was 0.4761 over 3 epochs. The command used for training is as follows:

torchrun --nproc_per_node=8 --master_port=3045 ./stanford_alpaca/train.py --model_name_or_path ./llama-7b-hf --data_path ./alpaca-7b-nativeEnhanced/training_files/alpaca-megaset-fixed.json --fp16 True --output_dir ./output_7b --num_train_epochs 3 --per_device_train_batch_size 2 --per_device_eval_batch_size 2 --gradient_accumulation_steps 16 --evaluation_strategy "no" --save_strategy "steps" --save_steps 200 --learning_rate 2e-5 --weight_decay 0. --warmup_ratio 0.03 --lr_scheduler_type "cosine" --logging_steps 1 --fsdp "full_shard auto_wrap" --fsdp_transformer_layer_cls_to_wrap 'LlamaDecoderLayer' --tf32 True

There's a folder in this repository called training_files. full-training-instructions.txt is the full list of commands from start to finish of training, to converting the model all the way to 4 bit quantized ggml. It is not recommended to quantize this model down to 4 bits. The instructions are included purely for informational purposes.

In addition, the training instructions file is built specifically for rented cloud computing. This means that by following the commands in the file, anyone should be able to train a similar model.

Common errors while training:

📝 Notes

🔧 Dataset

The dataset used for training this model is made from AlpacaDataCleaned and codealpaca. We combined these datasets for the following reasons:

  1. Increased accuracy since the original stanford_alpaca dataset had many errors.
  2. Better knowledge in programming
  3. More training data

We had an issue with the latest AlpacaDataCleaned dataset where at around 90k lines in, one of the keys has a typo. The key is "instruction:" instead of "instruction". We have fixed this error in the provided megaset but if you plan on grabbing directly from AlpacaDataCleaned, make sure to fix this error. Otherwise, the training script will fail due to a KeyError.

👨‍💻 Credits

Credits go to Meta for creating the foundational LLaMA models and Stanford for the instructions on how to train. For the dataset, credits go to AlpacaDataCleaned and codealpaca. Credits also go to chavinlo for creating the original Alpaca 7B Native model, the inspiration behind this model.

Lastly, credits go to the homies that stayed up all night again and again: 8bit, π, chug, Taddy, yoyodapro, Symax, and most importantly: stablediffusion for the beautiful artwork