Skip to content

salesforce/ctrl-detector

CTRL-detector

This directory contains the code for working with the CTRL output detector model, obtained by fine-tuning a RoBERTa model with the outputs of the CTRL model and GPT-2 model. Please see the model card for additional details.

Downloading a pre-trained detector model

Download the weights for the fine-tuned roberta-large detector model (1.5 GB) as shown below. This model performs optimally for longer text inputs (> 32 tokens minimum), e.g., a news article.

wget https://storage.googleapis.com/sfr-ctrl-detector/combine_256.pt

Running the detector model

You can launch a web UI in which you can enter a text and see the detector model's prediction on whether or not it was generated by a CTRL/GPT-2 model or written by human.

# (on the top-level directory of this repository)
pip install -r requirements.txt
python -m server

After the script says "Ready to serve", nagivate to http://localhost:8080 to view the UI.

Example script

Please see example.py for minimal code to run the detector model.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published