fofr / prompt-classifier

Determines the toxicity of text to image prompts, llama-13b fine-tune. [SAFETY_RANKING] between 0 (safe) and 10 (toxic)

  • Public
  • 1.9M runs
  • L40S

Input

*string
Shift + Return to add a new line

Prompt to send to the model.

integer
(minimum: 1)

Maximum number of tokens to generate. A word is generally 2-3 tokens

Default: 128

integer
(minimum: -1)

Minimum number of tokens to generate. To disable, set to -1. A word is generally 2-3 tokens.

Default: -1

number
(minimum: 0.01, maximum: 5)

Adjusts randomness of outputs, greater than 1 is random and 0 is deterministic, 0.75 is a good starting value.

Default: 0.75

number
(minimum: 0, maximum: 1)

When decoding text, samples from the top p percentage of most likely tokens; lower to ignore less likely tokens

Default: 0.9

integer
(minimum: 0)

When decoding text, samples from the top k most likely tokens; lower to ignore less likely tokens

Default: 50

string
Shift + Return to add a new line

A comma-separated list of sequences to stop generation at. For example, '<end>,<stop>' will stop generation at the first instance of 'end' or '<stop>'.

integer

Random seed. Leave blank to randomize the seed

boolean

provide debugging output in logs

Default: false

Output

0
Generated in

Run time and cost

This model costs approximately $0.019 to run on Replicate, or 52 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker.

This model runs on Nvidia L40S GPU hardware. Predictions typically complete within 20 seconds. The predict time for this model varies significantly based on the inputs.

Readme

[SAFETY_RANKING] is between 0 and 10.

0 is safe. 10 is very nsfw.

Trained on categories and reasons for ratings, these do not consistently work. The ranking does.