This LLM was fine-tuned on a curated corpus of Shakespeare’s complete works, including poems, plays, and sonnets. It uses the gpt-2 model from huggingface transformers. The model learns to generate text and complete the user's passage using Shakespeare’s unique linguistic style. The trained model is uploaded to Huggingface Hub and is accessed for inference via FastAPI from my web UI project.
To clone repo and re-train model locally:
- conda torch-nightly environment is recommended
- Install dependencies in
environment.yml. Runcheck_installation.pyto confirm. - Run
prepare_data.py - Run
train.py(will take around an hour) - Use
generate_text.pyto interact with your trained model