This project demonstrates how to fine-tune a GPT-3 model with legal text using the OpenAI API. The code provided in train.py
can be used to fine-tune a model to answer questions about legal text stored in a JSONL file. The model will be fine-tuned using the metadata from the JSON file.
- Python 3
- OpenAI API key
- Install the required packages by running
pip install -r requirements.txt
- Add your OpenAI API key as an environment variable named
OPENAI_API_KEY
- Update the
current_dir
variable intrain.py
to the directory where your JSONL file is stored - Run
python train.py
to fine-tune the model and prompt the model to answer a question.