Text Generation
Transformers
Safetensors
cohere
alignment-handbook
Generated from Trainer
conversational
text-generation-inference
Instructions to use simonycl/aya-advprompter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
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", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use simonycl/aya-advprompter with vLLM:
Install from pip and serve model
# 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?" } ] }'Use Docker
docker model run hf.co/simonycl/aya-advprompter
- SGLang
How to use simonycl/aya-advprompter with SGLang:
Install from pip and serve model
# 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?" } ] }'Use Docker images
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?" } ] }' - Docker Model Runner
How to use simonycl/aya-advprompter with Docker Model Runner:
docker model run hf.co/simonycl/aya-advprompter
metadata
library_name: transformers
license: cc-by-nc-4.0
base_model: CohereForAI/aya-23-8B
tags:
- alignment-handbook
- generated_from_trainer
datasets:
- simonycl/aya-23-8B_advprompter_jailbreak
model-index:
- name: aya-advprompter
results: []
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:
- Loss: 0.0459
- Rewards/chosen: 0.0182
- Rewards/rejected: -6.7884
- Rewards/accuracies: 1.0
- Rewards/margins: 6.8065
- Logps/rejected: -867.2261
- Logps/chosen: -114.6688
- Logits/rejected: 0.0796
- Logits/chosen: -0.2307
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-07
- train_batch_size: 1
- eval_batch_size: 1
- seed: 42
- distributed_type: multi-GPU
- num_devices: 2
- gradient_accumulation_steps: 16
- total_train_batch_size: 32
- total_eval_batch_size: 2
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.05
- num_epochs: 2
Training results
| 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 |
Framework versions
- Transformers 4.44.2
- Pytorch 2.3.0+cu121
- Datasets 2.21.0
- Tokenizers 0.19.1