simonycl/aya-23-8B_advprompter_jailbreak
Viewer • Updated • 3.2k • 49
How to use simonycl/aya-advprompter with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="simonycl/aya-advprompter")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("simonycl/aya-advprompter")
model = AutoModelForCausalLM.from_pretrained("simonycl/aya-advprompter")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use simonycl/aya-advprompter with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "simonycl/aya-advprompter"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "simonycl/aya-advprompter",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/simonycl/aya-advprompter
How to use simonycl/aya-advprompter with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "simonycl/aya-advprompter" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "simonycl/aya-advprompter",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "simonycl/aya-advprompter" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "simonycl/aya-advprompter",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use simonycl/aya-advprompter with Docker Model Runner:
docker model run hf.co/simonycl/aya-advprompter
This model is a fine-tuned version of CohereForAI/aya-23-8B on the simonycl/aya-23-8B_advprompter_jailbreak dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Logits/chosen | Logits/rejected | Logps/chosen | Logps/rejected | Validation Loss | Rewards/accuracies | Rewards/chosen | Rewards/margins | Rewards/rejected |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.5229 | 0.3612 | 30 | -0.4619 | -0.3434 | -98.2886 | -212.0101 | 0.5059 | 1.0 | 0.1820 | 0.4182 | -0.2362 |
| 0.2411 | 0.7223 | 60 | -0.4067 | -0.2327 | -88.9001 | -330.7860 | 0.2135 | 1.0 | 0.2758 | 1.6998 | -1.4240 |
| 0.0634 | 1.0835 | 90 | -0.2580 | -0.0357 | -99.5121 | -607.3592 | 0.0751 | 1.0 | 0.1697 | 4.3594 | -4.1897 |
| 0.0452 | 1.4454 | 120 | 0.0532 | 0.0757 | -5.9396 | 1.0 | 6.0153 | -782.3494 | -108.9159 | 0.0380 | -0.2345 |
| 0.0307 | 1.8066 | 150 | 0.0459 | 0.0182 | -6.7884 | 1.0 | 6.8065 | -867.2261 | -114.6688 | 0.0796 | -0.2307 |
Base model
CohereLabs/aya-23-8B