Text Generation
Transformers
Safetensors
mistral
trl
dpo
Generated from Trainer
conversational
text-generation-inference
Instructions to use wxzhang/dpo-selective-buffer-safeipo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wxzhang/dpo-selective-buffer-safeipo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wxzhang/dpo-selective-buffer-safeipo") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("wxzhang/dpo-selective-buffer-safeipo") model = AutoModelForCausalLM.from_pretrained("wxzhang/dpo-selective-buffer-safeipo", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use wxzhang/dpo-selective-buffer-safeipo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wxzhang/dpo-selective-buffer-safeipo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wxzhang/dpo-selective-buffer-safeipo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/wxzhang/dpo-selective-buffer-safeipo
- SGLang
How to use wxzhang/dpo-selective-buffer-safeipo 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 "wxzhang/dpo-selective-buffer-safeipo" \ --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": "wxzhang/dpo-selective-buffer-safeipo", "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 "wxzhang/dpo-selective-buffer-safeipo" \ --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": "wxzhang/dpo-selective-buffer-safeipo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use wxzhang/dpo-selective-buffer-safeipo with Docker Model Runner:
docker model run hf.co/wxzhang/dpo-selective-buffer-safeipo
Model save
Browse files- README.md +12 -12
- all_results.json +18 -18
- eval_results.json +14 -14
- model-00001-of-00003.safetensors +1 -1
- model-00002-of-00003.safetensors +1 -1
- model-00003-of-00003.safetensors +1 -1
- train_results.json +4 -4
- trainer_state.json +0 -0
- training_args.bin +1 -1
README.md
CHANGED
|
@@ -15,17 +15,17 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 15 |
|
| 16 |
This model was trained from scratch on the None dataset.
|
| 17 |
It achieves the following results on the evaluation set:
|
| 18 |
-
- Loss:
|
| 19 |
-
- Rewards/chosen: -
|
| 20 |
-
- Rewards/rejected: -
|
| 21 |
-
- Rewards/accuracies: 0.
|
| 22 |
-
- Rewards/margins: 0.
|
| 23 |
-
- Rewards/safe Rewards: -
|
| 24 |
-
- Rewards/unsafe Rewards: -
|
| 25 |
-
- Logps/rejected: -
|
| 26 |
-
- Logps/chosen: -
|
| 27 |
-
- Logits/rejected:
|
| 28 |
-
- Logits/chosen:
|
| 29 |
|
| 30 |
## Model description
|
| 31 |
|
|
@@ -62,7 +62,7 @@ The following hyperparameters were used during training:
|
|
| 62 |
|
| 63 |
| Training Loss | Epoch | Step | Validation Loss | Rewards/chosen | Rewards/rejected | Rewards/accuracies | Rewards/margins | Rewards/safe Rewards | Rewards/unsafe Rewards | Logps/rejected | Logps/chosen | Logits/rejected | Logits/chosen |
|
| 64 |
|:-------------:|:-----:|:----:|:---------------:|:--------------:|:----------------:|:------------------:|:---------------:|:--------------------:|:----------------------:|:--------------:|:------------:|:---------------:|:-------------:|
|
| 65 |
-
|
|
| 66 |
|
| 67 |
|
| 68 |
### Framework versions
|
|
|
|
| 15 |
|
| 16 |
This model was trained from scratch on the None dataset.
|
| 17 |
It achieves the following results on the evaluation set:
|
| 18 |
+
- Loss: 0.3423
|
| 19 |
+
- Rewards/chosen: -1.1017
|
| 20 |
+
- Rewards/rejected: -1.4092
|
| 21 |
+
- Rewards/accuracies: 0.7239
|
| 22 |
+
- Rewards/margins: 0.3075
|
| 23 |
+
- Rewards/safe Rewards: -1.0907
|
| 24 |
+
- Rewards/unsafe Rewards: -1.1124
|
| 25 |
+
- Logps/rejected: -233.3909
|
| 26 |
+
- Logps/chosen: -240.6112
|
| 27 |
+
- Logits/rejected: 1.7395
|
| 28 |
+
- Logits/chosen: 0.4896
|
| 29 |
|
| 30 |
## Model description
|
| 31 |
|
|
|
|
| 62 |
|
| 63 |
| Training Loss | Epoch | Step | Validation Loss | Rewards/chosen | Rewards/rejected | Rewards/accuracies | Rewards/margins | Rewards/safe Rewards | Rewards/unsafe Rewards | Logps/rejected | Logps/chosen | Logits/rejected | Logits/chosen |
|
| 64 |
|:-------------:|:-----:|:----:|:---------------:|:--------------:|:----------------:|:------------------:|:---------------:|:--------------------:|:----------------------:|:--------------:|:------------:|:---------------:|:-------------:|
|
| 65 |
+
| 0.9949 | 0.54 | 500 | 0.3472 | -1.0469 | -1.3054 | 0.7270 | 0.2585 | -1.0403 | -1.0519 | -223.0117 | -235.1269 | 2.0966 | 0.6950 |
|
| 66 |
|
| 67 |
|
| 68 |
### Framework versions
|
all_results.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
| 1 |
{
|
| 2 |
"epoch": 1.0,
|
| 3 |
-
"eval_logits/chosen":
|
| 4 |
-
"eval_logits/rejected":
|
| 5 |
-
"eval_logps/chosen": -
|
| 6 |
-
"eval_logps/rejected": -
|
| 7 |
-
"eval_loss":
|
| 8 |
-
"eval_rewards/accuracies": 0.
|
| 9 |
-
"eval_rewards/chosen": -
|
| 10 |
-
"eval_rewards/margins": 0.
|
| 11 |
-
"eval_rewards/rejected": -
|
| 12 |
-
"eval_rewards/safe_rewards": -
|
| 13 |
-
"eval_rewards/unsafe_rewards": -
|
| 14 |
-
"eval_runtime":
|
| 15 |
"eval_samples": 33044,
|
| 16 |
-
"eval_samples_per_second":
|
| 17 |
-
"eval_steps_per_second": 0.
|
| 18 |
-
"train_loss":
|
| 19 |
-
"train_runtime":
|
| 20 |
"train_samples": 59478,
|
| 21 |
-
"train_samples_per_second": 3.
|
| 22 |
-
"train_steps_per_second": 0.
|
| 23 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"epoch": 1.0,
|
| 3 |
+
"eval_logits/chosen": 0.48959165811538696,
|
| 4 |
+
"eval_logits/rejected": 1.7394596338272095,
|
| 5 |
+
"eval_logps/chosen": -240.6112060546875,
|
| 6 |
+
"eval_logps/rejected": -233.39085388183594,
|
| 7 |
+
"eval_loss": 0.34227725863456726,
|
| 8 |
+
"eval_rewards/accuracies": 0.7238625288009644,
|
| 9 |
+
"eval_rewards/chosen": -1.1017229557037354,
|
| 10 |
+
"eval_rewards/margins": 0.3074730932712555,
|
| 11 |
+
"eval_rewards/rejected": -1.4091962575912476,
|
| 12 |
+
"eval_rewards/safe_rewards": -1.090682029724121,
|
| 13 |
+
"eval_rewards/unsafe_rewards": -1.1124191284179688,
|
| 14 |
+
"eval_runtime": 1046.4049,
|
| 15 |
"eval_samples": 33044,
|
| 16 |
+
"eval_samples_per_second": 31.579,
|
| 17 |
+
"eval_steps_per_second": 0.987,
|
| 18 |
+
"train_loss": 1.0336197533828193,
|
| 19 |
+
"train_runtime": 18653.3333,
|
| 20 |
"train_samples": 59478,
|
| 21 |
+
"train_samples_per_second": 3.189,
|
| 22 |
+
"train_steps_per_second": 0.05
|
| 23 |
}
|
eval_results.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
{
|
| 2 |
"epoch": 1.0,
|
| 3 |
-
"eval_logits/chosen":
|
| 4 |
-
"eval_logits/rejected":
|
| 5 |
-
"eval_logps/chosen": -
|
| 6 |
-
"eval_logps/rejected": -
|
| 7 |
-
"eval_loss":
|
| 8 |
-
"eval_rewards/accuracies": 0.
|
| 9 |
-
"eval_rewards/chosen": -
|
| 10 |
-
"eval_rewards/margins": 0.
|
| 11 |
-
"eval_rewards/rejected": -
|
| 12 |
-
"eval_rewards/safe_rewards": -
|
| 13 |
-
"eval_rewards/unsafe_rewards": -
|
| 14 |
-
"eval_runtime":
|
| 15 |
"eval_samples": 33044,
|
| 16 |
-
"eval_samples_per_second":
|
| 17 |
-
"eval_steps_per_second": 0.
|
| 18 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"epoch": 1.0,
|
| 3 |
+
"eval_logits/chosen": 0.48959165811538696,
|
| 4 |
+
"eval_logits/rejected": 1.7394596338272095,
|
| 5 |
+
"eval_logps/chosen": -240.6112060546875,
|
| 6 |
+
"eval_logps/rejected": -233.39085388183594,
|
| 7 |
+
"eval_loss": 0.34227725863456726,
|
| 8 |
+
"eval_rewards/accuracies": 0.7238625288009644,
|
| 9 |
+
"eval_rewards/chosen": -1.1017229557037354,
|
| 10 |
+
"eval_rewards/margins": 0.3074730932712555,
|
| 11 |
+
"eval_rewards/rejected": -1.4091962575912476,
|
| 12 |
+
"eval_rewards/safe_rewards": -1.090682029724121,
|
| 13 |
+
"eval_rewards/unsafe_rewards": -1.1124191284179688,
|
| 14 |
+
"eval_runtime": 1046.4049,
|
| 15 |
"eval_samples": 33044,
|
| 16 |
+
"eval_samples_per_second": 31.579,
|
| 17 |
+
"eval_steps_per_second": 0.987
|
| 18 |
}
|
model-00001-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4943162336
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c0d3ffbcb96de65352cd9800707c3887845c0aad0360888d178eaa584ba7c742
|
| 3 |
size 4943162336
|
model-00002-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4999819336
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1154dc5968a3ed471182d5c8ee8642c6e4be50e1ea4582bd84b69b7177df4109
|
| 3 |
size 4999819336
|
model-00003-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4540516344
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eaac8c80e03387c80e37d2530add401bd8d45cf763c934f594c7221974f5dc16
|
| 3 |
size 4540516344
|
train_results.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
{
|
| 2 |
"epoch": 1.0,
|
| 3 |
-
"train_loss":
|
| 4 |
-
"train_runtime":
|
| 5 |
"train_samples": 59478,
|
| 6 |
-
"train_samples_per_second": 3.
|
| 7 |
-
"train_steps_per_second": 0.
|
| 8 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"epoch": 1.0,
|
| 3 |
+
"train_loss": 1.0336197533828193,
|
| 4 |
+
"train_runtime": 18653.3333,
|
| 5 |
"train_samples": 59478,
|
| 6 |
+
"train_samples_per_second": 3.189,
|
| 7 |
+
"train_steps_per_second": 0.05
|
| 8 |
}
|
trainer_state.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 6136
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e7ca9d4cd41515dc4e111e1ebc0b1c08a568c970597ec8bd9e83a31985bda8c0
|
| 3 |
size 6136
|