Brief GPT-2 lab source code and instructions set up as part of the Al/ML course in Cameroon
Reference: "Beginner’s Guide to Retrain GPT-2 (117M) to Generate Custom Text Content"
# gpt-2
Code from the paper "Language Models are Unsupervised Multitask Learners".
We have currently released small (117M parameter) and medium (345M parameter) versions of GPT-2. While we have not released the larger models, we have released a dataset for researchers to study their behaviors.
See more details in our blog post.
## Usage
This repository is meant to be a starting point for researchers and engineers to experiment with GPT-2.
### Some caveats
- GPT-2 models' robustness and worst case behaviors are not well-understood. As with any machine-learned model, carefully evaluate GPT-2 for your use case, especially if used without fine-tuning or in safety-critical applications where reliability is important.
- The dataset our GPT-2 models were trained on contains many texts with biases and factual inaccuracies, and thus GPT-2 models are likely to be biased and inaccurate as well.
- To avoid having samples mistaken as human-written, we recommend clearly labeling samples as synthetic before wide dissemination. Our models are often incoherent or inaccurate in subtle ways, which takes more than a quick read for a human to notice.
### Work with us
Please let us know if you’re doing interesting research with or working on applications of GPT-2! We’re especially interested in hearing from and potentially working with those who are studying
- Potential malicious use cases and defenses against them (e.g. the detectability of synthetic text)
- The extent of problematic content (e.g. bias) being baked into the models and effective mitigations
## Development
See DEVELOPERS.md
## Contributors
See CONTRIBUTORS.md
## Fine tuning on custom datasets
To retrain GPT-2 117M model on a custom text dataset:
```
PYTHONPATH=src ./train.py --dataset
```
If you want to precompute the dataset's encoding for multiple runs, you can instead use:
```
PYTHONPATH=src ./encode.py /path …