CoolFace
Apppublic

webstuff/openai-detector

sourceHugging Faceupdated 4y agoView on Hugging Face
0likes
README.md52 linesDownload Raw Back to detector
1GPT-2 Output Detector2=====================3 4This directory contains the code for working with the GPT-2 output detector model, obtained by fine-tuning a5[RoBERTa model](https://ai.facebook.com/blog/roberta-an-optimized-method-for-pretraining-self-supervised-nlp-systems/)6with [the outputs of the 1.5B-parameter GPT-2 model](https://github.com/openai/gpt-2-output-dataset).7For motivations and discussions regarding the release of this detector model, please check out 8[our blog post](https://openai.com/blog/gpt-2-1-5b-release/) and [report](https://d4mucfpksywv.cloudfront.net/papers/GPT_2_Report.pdf).9 10## Downloading a pre-trained detector model11 12Download the weights for the fine-tuned `roberta-base` model (478 MB):13 14```bash15wget https://storage.googleapis.com/gpt-2/detector-models/v1/detector-base.pt16```17 18or `roberta-large` model (1.5 GB):19 20```bash21wget https://storage.googleapis.com/gpt-2/detector-models/v1/detector-large.pt22```23 24These RoBERTa-based models are fine-tuned with a mixture of temperature-1 and nucleus sampling outputs,25which should generalize well to outputs generated using different sampling methods.26 27## Running a detector model28 29You can launch a web UI in which you can enter a text and see the detector model's prediction30on whether or not it was generated by a GPT-2 model.31 32```bash33# (on the top-level directory of this repository)34pip install -r requirements.txt35python -m detector.server detector-base.pt36```37 38After the script says "Ready to serve", nagivate to http://localhost:8080 to view the UI.39 40## Training a new detector model41 42You can use the provided training script to train a detector model on a new set of datasets.43We recommend using a GPU machine for this task.44 45```bash46# (on the top-level directory of this repository)47pip install -r requirements.txt48python -m detector.train49```50 51The training script supports a number of different options; append `--help` to the command above for usage.52