Spindle is a mixed-initiative tool for writing interactive, branching fiction. Released under the UC BSD-4-Clause.
Warning! This codebase requires you fine-tune your own model as I am not able to share my fine-tuned model via OpenAI. Instructions are below, but it might be a little fiddly.
This repo contains all resources needed to collect training data and fine-tune your own model for under $10.
You must have Python 3.7 for this project. Optionally, I recommend using a virtual environment like conda for managing the environments as follows.
conda create -n spindle python=3.7
conda activate spindle
Install the python 3 requirements.
pip install -r src/requirements.txt
Download the largest spacy language model.
chmod +x src/setup_spacy.sh
src/setup_spacy.sh
Add your OpenAI API Key
Navigate to https://beta.openai.com/account/api-keys. Copy your key and set it as an environment variable.
export OPENAI_API_KEY=<YOUR_KEY>
python src/spindle.py
-
Twine games from itch.io
python src/training/data_collection.py
- Run through the cells in
src/create_contextual_training_data.ipynb
- Will create a file that can be uploaded to GPT-3 for fine-tuning
python src/spindle.py