Text Generation
Transformers
TensorBoard
Safetensors
gemma2
alignment-handbook
trl
dpo
Generated from Trainer
conversational
text-generation-inference
Instructions to use tanliboy/lambda-gemma-2-9b-dpo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tanliboy/lambda-gemma-2-9b-dpo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tanliboy/lambda-gemma-2-9b-dpo") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tanliboy/lambda-gemma-2-9b-dpo") model = AutoModelForCausalLM.from_pretrained("tanliboy/lambda-gemma-2-9b-dpo", 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 tanliboy/lambda-gemma-2-9b-dpo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tanliboy/lambda-gemma-2-9b-dpo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tanliboy/lambda-gemma-2-9b-dpo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tanliboy/lambda-gemma-2-9b-dpo
- SGLang
How to use tanliboy/lambda-gemma-2-9b-dpo 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 "tanliboy/lambda-gemma-2-9b-dpo" \ --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": "tanliboy/lambda-gemma-2-9b-dpo", "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 "tanliboy/lambda-gemma-2-9b-dpo" \ --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": "tanliboy/lambda-gemma-2-9b-dpo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tanliboy/lambda-gemma-2-9b-dpo with Docker Model Runner:
docker model run hf.co/tanliboy/lambda-gemma-2-9b-dpo
End of training
Browse files- README.md +16 -10
- all_results.json +13 -0
- config.json +1 -1
- eval_results.json +13 -13
- runs/Jul25_01-23-17_action-graph-trainer/events.out.tfevents.1721883328.action-graph-trainer.762006.1 +3 -0
README.md
CHANGED
|
@@ -2,9 +2,15 @@
|
|
| 2 |
license: gemma
|
| 3 |
base_model: tanliboy/zephyr-gemma-2-9b-sft
|
| 4 |
tags:
|
|
|
|
| 5 |
- trl
|
| 6 |
- dpo
|
| 7 |
- generated_from_trainer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
model-index:
|
| 9 |
- name: zephyr-gemma-2-9b-dpo-2
|
| 10 |
results: []
|
|
@@ -16,17 +22,17 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 16 |
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="200" height="32"/>](https://wandb.ai/tanliboy/huggingface/runs/dikk0994)
|
| 17 |
# zephyr-gemma-2-9b-dpo-2
|
| 18 |
|
| 19 |
-
This model is a fine-tuned version of [tanliboy/zephyr-gemma-2-9b-sft](https://huggingface.co/tanliboy/zephyr-gemma-2-9b-sft) on
|
| 20 |
It achieves the following results on the evaluation set:
|
| 21 |
-
- Loss: 0.
|
| 22 |
-
- Rewards/chosen: -0.
|
| 23 |
-
- Rewards/rejected: -1.
|
| 24 |
-
- Rewards/accuracies: 0.
|
| 25 |
-
- Rewards/margins: 0.
|
| 26 |
-
- Logps/rejected: -
|
| 27 |
-
- Logps/chosen: -
|
| 28 |
-
- Logits/rejected: -14.
|
| 29 |
-
- Logits/chosen: -14.
|
| 30 |
|
| 31 |
## Model description
|
| 32 |
|
|
|
|
| 2 |
license: gemma
|
| 3 |
base_model: tanliboy/zephyr-gemma-2-9b-sft
|
| 4 |
tags:
|
| 5 |
+
- alignment-handbook
|
| 6 |
- trl
|
| 7 |
- dpo
|
| 8 |
- generated_from_trainer
|
| 9 |
+
- trl
|
| 10 |
+
- dpo
|
| 11 |
+
- generated_from_trainer
|
| 12 |
+
datasets:
|
| 13 |
+
- HuggingFaceH4/ultrafeedback_binarized
|
| 14 |
model-index:
|
| 15 |
- name: zephyr-gemma-2-9b-dpo-2
|
| 16 |
results: []
|
|
|
|
| 22 |
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="200" height="32"/>](https://wandb.ai/tanliboy/huggingface/runs/dikk0994)
|
| 23 |
# zephyr-gemma-2-9b-dpo-2
|
| 24 |
|
| 25 |
+
This model is a fine-tuned version of [tanliboy/zephyr-gemma-2-9b-sft](https://huggingface.co/tanliboy/zephyr-gemma-2-9b-sft) on the HuggingFaceH4/ultrafeedback_binarized dataset.
|
| 26 |
It achieves the following results on the evaluation set:
|
| 27 |
+
- Loss: 0.5628
|
| 28 |
+
- Rewards/chosen: -0.7292
|
| 29 |
+
- Rewards/rejected: -1.2825
|
| 30 |
+
- Rewards/accuracies: 0.6960
|
| 31 |
+
- Rewards/margins: 0.5533
|
| 32 |
+
- Logps/rejected: -1566.9301
|
| 33 |
+
- Logps/chosen: -1043.5624
|
| 34 |
+
- Logits/rejected: -14.1720
|
| 35 |
+
- Logits/chosen: -14.6638
|
| 36 |
|
| 37 |
## Model description
|
| 38 |
|
all_results.json
CHANGED
|
@@ -1,5 +1,18 @@
|
|
| 1 |
{
|
| 2 |
"epoch": 0.9965977492802931,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
"total_flos": 0.0,
|
| 4 |
"train_loss": 0.6157421479706003,
|
| 5 |
"train_runtime": 11733.4361,
|
|
|
|
| 1 |
{
|
| 2 |
"epoch": 0.9965977492802931,
|
| 3 |
+
"eval_logits/chosen": -14.663813591003418,
|
| 4 |
+
"eval_logits/rejected": -14.17200756072998,
|
| 5 |
+
"eval_logps/chosen": -1043.5623779296875,
|
| 6 |
+
"eval_logps/rejected": -1566.9300537109375,
|
| 7 |
+
"eval_loss": 0.5627544522285461,
|
| 8 |
+
"eval_rewards/accuracies": 0.6959999799728394,
|
| 9 |
+
"eval_rewards/chosen": -0.7292414307594299,
|
| 10 |
+
"eval_rewards/margins": 0.5532797574996948,
|
| 11 |
+
"eval_rewards/rejected": -1.2825212478637695,
|
| 12 |
+
"eval_runtime": 148.9641,
|
| 13 |
+
"eval_samples": 2000,
|
| 14 |
+
"eval_samples_per_second": 13.426,
|
| 15 |
+
"eval_steps_per_second": 0.839,
|
| 16 |
"total_flos": 0.0,
|
| 17 |
"train_loss": 0.6157421479706003,
|
| 18 |
"train_runtime": 11733.4361,
|
config.json
CHANGED
|
@@ -29,6 +29,6 @@
|
|
| 29 |
"sliding_window_size": 4096,
|
| 30 |
"torch_dtype": "bfloat16",
|
| 31 |
"transformers_version": "4.43.1",
|
| 32 |
-
"use_cache":
|
| 33 |
"vocab_size": 256000
|
| 34 |
}
|
|
|
|
| 29 |
"sliding_window_size": 4096,
|
| 30 |
"torch_dtype": "bfloat16",
|
| 31 |
"transformers_version": "4.43.1",
|
| 32 |
+
"use_cache": true,
|
| 33 |
"vocab_size": 256000
|
| 34 |
}
|
eval_results.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
{
|
| 2 |
-
"epoch": 0.
|
| 3 |
-
"eval_logits/chosen": -14.
|
| 4 |
-
"eval_logits/rejected": -14.
|
| 5 |
-
"eval_logps/chosen": -
|
| 6 |
-
"eval_logps/rejected": -
|
| 7 |
-
"eval_loss": 0.
|
| 8 |
-
"eval_rewards/accuracies": 0.
|
| 9 |
-
"eval_rewards/chosen": -0.
|
| 10 |
-
"eval_rewards/margins": 0.
|
| 11 |
-
"eval_rewards/rejected": -1.
|
| 12 |
-
"eval_runtime": 148.
|
| 13 |
"eval_samples": 2000,
|
| 14 |
-
"eval_samples_per_second": 13.
|
| 15 |
-
"eval_steps_per_second": 0.
|
| 16 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"epoch": 0.9965977492802931,
|
| 3 |
+
"eval_logits/chosen": -14.663813591003418,
|
| 4 |
+
"eval_logits/rejected": -14.17200756072998,
|
| 5 |
+
"eval_logps/chosen": -1043.5623779296875,
|
| 6 |
+
"eval_logps/rejected": -1566.9300537109375,
|
| 7 |
+
"eval_loss": 0.5627544522285461,
|
| 8 |
+
"eval_rewards/accuracies": 0.6959999799728394,
|
| 9 |
+
"eval_rewards/chosen": -0.7292414307594299,
|
| 10 |
+
"eval_rewards/margins": 0.5532797574996948,
|
| 11 |
+
"eval_rewards/rejected": -1.2825212478637695,
|
| 12 |
+
"eval_runtime": 148.9641,
|
| 13 |
"eval_samples": 2000,
|
| 14 |
+
"eval_samples_per_second": 13.426,
|
| 15 |
+
"eval_steps_per_second": 0.839
|
| 16 |
}
|
runs/Jul25_01-23-17_action-graph-trainer/events.out.tfevents.1721883328.action-graph-trainer.762006.1
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d04ba8b066fe7c9986abc7fb42d8f7072e5464d05e67bd4d250128eb7fc27d4e
|
| 3 |
+
size 828
|