Skip to content

dw-innovation/llm-training

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM Training

This repository is intended to use for training HuggingFace models for the ReCo projects.

Installation with Docker

Build docker and start training as follows:

Docker Building:

docker build -t llm_training:latest .

run the following commmand if you can not build its docker, because we have a limited space and don't want to occupy unncessary spaces

sudo docker rmi $(docker images -f "dangling=true" -q) --force

Fine-tuning

Before training the model, you need to create .env file since we need to use GPU 1. Add GPU_DEVICE=1 to .env.

Model training:

screen -L -Logfile {LOGFILE_NAME} sudo docker run --rm --gpus all -v /reco/llm-training/:/app --env-file .env --name llm_training llm_training:latest bash scripts/spot/train_{MODEL_PREFIX}.sh

Model testing, you need to remove --train from the script and to run the above script.

To fine-tune Llama2, make sure that you add HF credentials in .env as follows:

HF_INFERENCE_TOKEN=YOUR_TOKEN

Zero-shot Learning

Zero-shot learning codes for ChatGPT and Llama2 are located under app/nshot/{model_name}_zero_shot.py.

Run the following command to get predictions from ChatGPT

bash scripts/{TASK_NAME}/zero_shot_chatgpt.sh

Run the following command to get predictions from Llama2

bash scripts/{TASK_NAME}/zero_shot_llama.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published