Text Generation
Transformers
Safetensors
mistral
alignment-handbook
trl
dpo
Generated from Trainer
conversational
text-generation-inference
Instructions to use YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03") 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("YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03") model = AutoModelForCausalLM.from_pretrained("YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03", 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 YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03
- SGLang
How to use YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03 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 "YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03" \ --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": "YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03", "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 "YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03" \ --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": "YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03 with Docker Model Runner:
docker model run hf.co/YeongminKim/zephyr-7b-dpo-full-alpha_0.5_batch64_0.03
End of training
Browse files- README.md +15 -9
- all_results.json +13 -0
- config.json +1 -1
- eval_results.json +16 -0
README.md
CHANGED
|
@@ -3,9 +3,15 @@ library_name: transformers
|
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: alignment-handbook/zephyr-7b-sft-full
|
| 5 |
tags:
|
|
|
|
| 6 |
- trl
|
| 7 |
- dpo
|
| 8 |
- generated_from_trainer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
model-index:
|
| 10 |
- name: zephyr-7b-dpo-full-alpha_0.5_batch64_0.03
|
| 11 |
results: []
|
|
@@ -16,17 +22,17 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 16 |
|
| 17 |
# zephyr-7b-dpo-full-alpha_0.5_batch64_0.03
|
| 18 |
|
| 19 |
-
This model is a fine-tuned version of [alignment-handbook/zephyr-7b-sft-full](https://huggingface.co/alignment-handbook/zephyr-7b-sft-full) on the
|
| 20 |
It achieves the following results on the evaluation set:
|
| 21 |
-
- Loss: 0.
|
| 22 |
-
- Rewards/chosen: -1.
|
| 23 |
-
- Rewards/rejected: -2.
|
| 24 |
- Rewards/accuracies: 0.7857
|
| 25 |
-
- Rewards/margins: 1.
|
| 26 |
-
- Logps/rejected: -
|
| 27 |
-
- Logps/chosen: -
|
| 28 |
-
- Logits/rejected: 0.
|
| 29 |
-
- Logits/chosen: -0.
|
| 30 |
|
| 31 |
## Model description
|
| 32 |
|
|
|
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: alignment-handbook/zephyr-7b-sft-full
|
| 5 |
tags:
|
| 6 |
+
- alignment-handbook
|
| 7 |
- trl
|
| 8 |
- dpo
|
| 9 |
- generated_from_trainer
|
| 10 |
+
- trl
|
| 11 |
+
- dpo
|
| 12 |
+
- generated_from_trainer
|
| 13 |
+
datasets:
|
| 14 |
+
- HuggingFaceH4/ultrafeedback_binarized
|
| 15 |
model-index:
|
| 16 |
- name: zephyr-7b-dpo-full-alpha_0.5_batch64_0.03
|
| 17 |
results: []
|
|
|
|
| 22 |
|
| 23 |
# zephyr-7b-dpo-full-alpha_0.5_batch64_0.03
|
| 24 |
|
| 25 |
+
This model is a fine-tuned version of [alignment-handbook/zephyr-7b-sft-full](https://huggingface.co/alignment-handbook/zephyr-7b-sft-full) on the HuggingFaceH4/ultrafeedback_binarized dataset.
|
| 26 |
It achieves the following results on the evaluation set:
|
| 27 |
+
- Loss: 0.7789
|
| 28 |
+
- Rewards/chosen: -1.3273
|
| 29 |
+
- Rewards/rejected: -2.3422
|
| 30 |
- Rewards/accuracies: 0.7857
|
| 31 |
+
- Rewards/margins: 1.0149
|
| 32 |
+
- Logps/rejected: -494.4228
|
| 33 |
+
- Logps/chosen: -414.7076
|
| 34 |
+
- Logits/rejected: 0.3577
|
| 35 |
+
- Logits/chosen: -0.7982
|
| 36 |
|
| 37 |
## Model description
|
| 38 |
|
all_results.json
CHANGED
|
@@ -1,5 +1,18 @@
|
|
| 1 |
{
|
| 2 |
"epoch": 0.9994767137624281,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
"total_flos": 0.0,
|
| 4 |
"train_loss": 0.8168348412239115,
|
| 5 |
"train_runtime": 34624.4791,
|
|
|
|
| 1 |
{
|
| 2 |
"epoch": 0.9994767137624281,
|
| 3 |
+
"eval_logits/chosen": -0.7981740236282349,
|
| 4 |
+
"eval_logits/rejected": 0.35771894454956055,
|
| 5 |
+
"eval_logps/chosen": -414.70758056640625,
|
| 6 |
+
"eval_logps/rejected": -494.42279052734375,
|
| 7 |
+
"eval_loss": 0.7788758277893066,
|
| 8 |
+
"eval_rewards/accuracies": 0.7857142686843872,
|
| 9 |
+
"eval_rewards/chosen": -1.3273053169250488,
|
| 10 |
+
"eval_rewards/margins": 1.0148944854736328,
|
| 11 |
+
"eval_rewards/rejected": -2.3421998023986816,
|
| 12 |
+
"eval_runtime": 408.2742,
|
| 13 |
+
"eval_samples": 2000,
|
| 14 |
+
"eval_samples_per_second": 4.899,
|
| 15 |
+
"eval_steps_per_second": 0.154,
|
| 16 |
"total_flos": 0.0,
|
| 17 |
"train_loss": 0.8168348412239115,
|
| 18 |
"train_runtime": 34624.4791,
|
config.json
CHANGED
|
@@ -22,6 +22,6 @@
|
|
| 22 |
"tie_word_embeddings": false,
|
| 23 |
"torch_dtype": "bfloat16",
|
| 24 |
"transformers_version": "4.44.2",
|
| 25 |
-
"use_cache":
|
| 26 |
"vocab_size": 32000
|
| 27 |
}
|
|
|
|
| 22 |
"tie_word_embeddings": false,
|
| 23 |
"torch_dtype": "bfloat16",
|
| 24 |
"transformers_version": "4.44.2",
|
| 25 |
+
"use_cache": true,
|
| 26 |
"vocab_size": 32000
|
| 27 |
}
|
eval_results.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"epoch": 0.9994767137624281,
|
| 3 |
+
"eval_logits/chosen": -0.7981740236282349,
|
| 4 |
+
"eval_logits/rejected": 0.35771894454956055,
|
| 5 |
+
"eval_logps/chosen": -414.70758056640625,
|
| 6 |
+
"eval_logps/rejected": -494.42279052734375,
|
| 7 |
+
"eval_loss": 0.7788758277893066,
|
| 8 |
+
"eval_rewards/accuracies": 0.7857142686843872,
|
| 9 |
+
"eval_rewards/chosen": -1.3273053169250488,
|
| 10 |
+
"eval_rewards/margins": 1.0148944854736328,
|
| 11 |
+
"eval_rewards/rejected": -2.3421998023986816,
|
| 12 |
+
"eval_runtime": 408.2742,
|
| 13 |
+
"eval_samples": 2000,
|
| 14 |
+
"eval_samples_per_second": 4.899,
|
| 15 |
+
"eval_steps_per_second": 0.154
|
| 16 |
+
}
|