You're looking at a specific version of this model. Jump to the model overview.
fofr /prompt-classifier:1ffac777
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run fofr/prompt-classifier using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"fofr/prompt-classifier:1ffac777bf2c1f5a4a5073faf389fefe59a8b9326b3ca329e9d576cce658a00f",
{
input: {
debug: false,
top_k: 50,
top_p: 0.9,
prompt: "[PROMPT] a photo of a cat [/PROMPT] [SAFETY_RANKING]",
temperature: 0.75,
max_new_tokens: 128,
min_new_tokens: -1,
stop_sequences: "[/SAFETY_RANKING]"
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run fofr/prompt-classifier using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"fofr/prompt-classifier:1ffac777bf2c1f5a4a5073faf389fefe59a8b9326b3ca329e9d576cce658a00f",
input={
"debug": False,
"top_k": 50,
"top_p": 0.9,
"prompt": "[PROMPT] a photo of a cat [/PROMPT] [SAFETY_RANKING]",
"temperature": 0.75,
"max_new_tokens": 128,
"min_new_tokens": -1,
"stop_sequences": "[/SAFETY_RANKING]"
}
)
# The fofr/prompt-classifier model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/fofr/prompt-classifier/api#output-schema
print(item, end="")
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run fofr/prompt-classifier using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "1ffac777bf2c1f5a4a5073faf389fefe59a8b9326b3ca329e9d576cce658a00f",
"input": {
"debug": false,
"top_k": 50,
"top_p": 0.9,
"prompt": "[PROMPT] a photo of a cat [/PROMPT] [SAFETY_RANKING]",
"temperature": 0.75,
"max_new_tokens": 128,
"min_new_tokens": -1,
"stop_sequences": "[/SAFETY_RANKING]"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2023-09-12T10:08:01.341083Z",
"created_at": "2023-09-12T10:08:00.974327Z",
"data_removed": false,
"error": null,
"id": "rgvlpudbjwcyhwzwmjszt5dwku",
"input": {
"debug": false,
"top_k": 50,
"top_p": 0.9,
"prompt": "[PROMPT] a photo of a cat [/PROMPT] [SAFETY_RANKING]",
"temperature": 0.75,
"max_new_tokens": 128,
"min_new_tokens": -1,
"stop_sequences": "[/SAFETY_RANKING]"
},
"logs": "Your formatted prompt is:\n[PROMPT] a photo of a cat [/PROMPT] [SAFETY_RANKING]\ncorrect lora is already loaded\nOverall initialize_peft took 0.0000\nhostname: model-hs-f65583d2-ad5558a4ca97250e-gpu-a40-594759b748-kqvz9",
"metrics": {
"predict_time": 0.408096,
"total_time": 0.366756
},
"output": [
" ",
"0",
" "
],
"started_at": "2023-09-12T10:08:00.932987Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/rgvlpudbjwcyhwzwmjszt5dwku",
"cancel": "https://api.replicate.com/v1/predictions/rgvlpudbjwcyhwzwmjszt5dwku/cancel"
},
"version": "1ffac777bf2c1f5a4a5073faf389fefe59a8b9326b3ca329e9d576cce658a00f"
}
Your formatted prompt is:
[PROMPT] a photo of a cat [/PROMPT] [SAFETY_RANKING]
correct lora is already loaded
Overall initialize_peft took 0.0000
hostname: model-hs-f65583d2-ad5558a4ca97250e-gpu-a40-594759b748-kqvz9