This project utilizes fine-tuned language models to generate dialogues based on the "Call of Cthulhu" role-playing game.
- Create and activate a new Conda environment:
conda create -n coc python=3.8 conda activate coc
- Install required dependencies:
pip install -r requirements.txt
- Set up Accelerate with DeepSpeed:
accelerate config
Adjust the DeepSpeed settings to meet your requirements by modifying the configuration file located at config/deepspeed.json.
The dataset is located at data/coc_dialogue.json and is specifically crafted for fine-tuning the language model on CoC dialogue generation.
The folder coc_data_gen/ details the process of dataset generation using the GPT-3.5-turbo API.
Download the supervised fine-tuned weights for Baichuan-7B and Llama2-7B from the following link:
To train the language model, use the following command which leverages Accelerate with DeepSpeed:
ACCELERATE_USE_DEEPSPEED=true CUDA_VISIBLE_DEVICES="0,1" accelerate launch finetuning.pyAdjust the CUDA_VISIBLE_DEVICES parameter as necessary to specify the GPUs you intend to use.
Generate dialogues with the trained model by running:
python inference.pyThis script takes prompts and generates dialogues using the fine-tuned model.
coc_data_gen/: Scripts for CoC dataset generation using the GPT-3.5-turbo API.config/: DeepSpeed configuration file.data/: CoC dialogue dataset and additional evaluation data.samples/: Sample prompts for inference.finetuning.py: Training script for the language model.inference.py: Inference script for dialogue generation.requirements.txt: Required Python dependencies.
This project is released under the MIT License.