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") 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
- 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
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/igf2ndcz)
|
| 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: -407.
|
| 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/igf2ndcz)
|
| 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.5277
|
| 28 |
+
- Rewards/chosen: -0.6084
|
| 29 |
+
- Rewards/rejected: -1.2304
|
| 30 |
+
- Rewards/accuracies: 0.6880
|
| 31 |
+
- Rewards/margins: 0.6220
|
| 32 |
+
- Logps/rejected: -407.4499
|
| 33 |
+
- Logps/chosen: -375.1572
|
| 34 |
+
- Logits/rejected: -14.2928
|
| 35 |
+
- Logits/chosen: -14.1056
|
| 36 |
|
| 37 |
## Model description
|
| 38 |
|
all_results.json
CHANGED
|
@@ -1,5 +1,18 @@
|
|
| 1 |
{
|
| 2 |
"epoch": 0.9997382884061764,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
"total_flos": 0.0,
|
| 4 |
"train_loss": 0.560625178402007,
|
| 5 |
"train_runtime": 12630.0326,
|
|
|
|
| 1 |
{
|
| 2 |
"epoch": 0.9997382884061764,
|
| 3 |
+
"eval_logits/chosen": -14.105589866638184,
|
| 4 |
+
"eval_logits/rejected": -14.292818069458008,
|
| 5 |
+
"eval_logps/chosen": -375.1571960449219,
|
| 6 |
+
"eval_logps/rejected": -407.44989013671875,
|
| 7 |
+
"eval_loss": 0.5276930332183838,
|
| 8 |
+
"eval_rewards/accuracies": 0.6880000233650208,
|
| 9 |
+
"eval_rewards/chosen": -0.6083627939224243,
|
| 10 |
+
"eval_rewards/margins": 0.6220458149909973,
|
| 11 |
+
"eval_rewards/rejected": -1.2304086685180664,
|
| 12 |
+
"eval_runtime": 148.4787,
|
| 13 |
+
"eval_samples": 2000,
|
| 14 |
+
"eval_samples_per_second": 13.47,
|
| 15 |
+
"eval_steps_per_second": 0.842,
|
| 16 |
"total_flos": 0.0,
|
| 17 |
"train_loss": 0.560625178402007,
|
| 18 |
"train_runtime": 12630.0326,
|
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
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"epoch": 0.9997382884061764,
|
| 3 |
+
"eval_logits/chosen": -14.105589866638184,
|
| 4 |
+
"eval_logits/rejected": -14.292818069458008,
|
| 5 |
+
"eval_logps/chosen": -375.1571960449219,
|
| 6 |
+
"eval_logps/rejected": -407.44989013671875,
|
| 7 |
+
"eval_loss": 0.5276930332183838,
|
| 8 |
+
"eval_rewards/accuracies": 0.6880000233650208,
|
| 9 |
+
"eval_rewards/chosen": -0.6083627939224243,
|
| 10 |
+
"eval_rewards/margins": 0.6220458149909973,
|
| 11 |
+
"eval_rewards/rejected": -1.2304086685180664,
|
| 12 |
+
"eval_runtime": 148.4787,
|
| 13 |
+
"eval_samples": 2000,
|
| 14 |
+
"eval_samples_per_second": 13.47,
|
| 15 |
+
"eval_steps_per_second": 0.842
|
| 16 |
+
}
|
runs/Jul24_07-13-12_action-graph-trainer/events.out.tfevents.1721818858.action-graph-trainer.576983.1
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4fdc71b8eef9caecadac21ec5659a7e65acb893053a8eacdcab16cdf09c06837
|
| 3 |
+
size 828
|