Skip to content
dragonscypherPublic

About

Tool for generating smart and secure prompts for language models!

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prompty

A command-line script (gen.py) that turns a rough description into a cleaner prompt and checks it for prompt injection before you use it.

Pipeline

  1. Grammar correction with prithivida/grammar_error_correcter_v1.
  2. Translation to English with Helsinki-NLP/opus-mt-de-en.
  3. Summarization with facebook/bart-large-cnn.
  4. The result is wrapped as "Create a detailed guide for: ...".
  5. protectai/deberta-v3-base-prompt-injection-v2 classifies the final prompt and prints a warning if it looks like an injection.

All models run on CPU through Hugging Face Transformers.

Running it

git clone https://github.com/dragonscypher/Prompty
cd Prompty
pip install -r requirements.txt
python gen.py

The first run downloads the models, which takes a while.

Limits

The translation model is German-to-English only, so other languages pass through unchanged. The injection check is a classifier, not a guarantee.

About

Tool for generating smart and secure prompts for language models!

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages