Text Generation
Transformers
Safetensors
qwen2
Generated from Trainer
trl
dpo
conversational
text-generation-inference
Instructions to use obiwit/qwen2.5-3b-dpo-vanilla-no-tools with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use obiwit/qwen2.5-3b-dpo-vanilla-no-tools with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="obiwit/qwen2.5-3b-dpo-vanilla-no-tools", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("obiwit/qwen2.5-3b-dpo-vanilla-no-tools") model = AutoModelForCausalLM.from_pretrained("obiwit/qwen2.5-3b-dpo-vanilla-no-tools", 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 obiwit/qwen2.5-3b-dpo-vanilla-no-tools with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "obiwit/qwen2.5-3b-dpo-vanilla-no-tools" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "obiwit/qwen2.5-3b-dpo-vanilla-no-tools", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/obiwit/qwen2.5-3b-dpo-vanilla-no-tools
- SGLang
How to use obiwit/qwen2.5-3b-dpo-vanilla-no-tools 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 "obiwit/qwen2.5-3b-dpo-vanilla-no-tools" \ --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": "obiwit/qwen2.5-3b-dpo-vanilla-no-tools", "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 "obiwit/qwen2.5-3b-dpo-vanilla-no-tools" \ --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": "obiwit/qwen2.5-3b-dpo-vanilla-no-tools", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use obiwit/qwen2.5-3b-dpo-vanilla-no-tools with Docker Model Runner:
docker model run hf.co/obiwit/qwen2.5-3b-dpo-vanilla-no-tools
Model save
Browse files- README.md +1 -1
- all_results.json +3 -3
- config.json +1 -1
- train_results.json +3 -3
- trainer_state.json +3 -3
- training_args.bin +1 -1
README.md
CHANGED
|
@@ -27,7 +27,7 @@ print(output["generated_text"])
|
|
| 27 |
|
| 28 |
## Training procedure
|
| 29 |
|
| 30 |
-
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/bborges/CriteriaPreferences/runs/
|
| 31 |
|
| 32 |
This model was trained with DPO, a method introduced in [Direct Preference Optimization: Your Language Model is Secretly a Reward Model](https://huggingface.co/papers/2305.18290).
|
| 33 |
|
|
|
|
| 27 |
|
| 28 |
## Training procedure
|
| 29 |
|
| 30 |
+
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/bborges/CriteriaPreferences/runs/meb4alvj)
|
| 31 |
|
| 32 |
This model was trained with DPO, a method introduced in [Direct Preference Optimization: Your Language Model is Secretly a Reward Model](https://huggingface.co/papers/2305.18290).
|
| 33 |
|
all_results.json
CHANGED
|
@@ -15,8 +15,8 @@
|
|
| 15 |
"eval_steps_per_second": 0.492,
|
| 16 |
"total_flos": 0.0,
|
| 17 |
"train_loss": 0.0,
|
| 18 |
-
"train_runtime":
|
| 19 |
"train_samples": 3438778,
|
| 20 |
-
"train_samples_per_second":
|
| 21 |
-
"train_steps_per_second":
|
| 22 |
}
|
|
|
|
| 15 |
"eval_steps_per_second": 0.492,
|
| 16 |
"total_flos": 0.0,
|
| 17 |
"train_loss": 0.0,
|
| 18 |
+
"train_runtime": 20.8147,
|
| 19 |
"train_samples": 3438778,
|
| 20 |
+
"train_samples_per_second": 165208.979,
|
| 21 |
+
"train_steps_per_second": 1290.673
|
| 22 |
}
|
config.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
| 24 |
"tie_word_embeddings": true,
|
| 25 |
"torch_dtype": "bfloat16",
|
| 26 |
"transformers_version": "4.46.3",
|
| 27 |
-
"use_cache":
|
| 28 |
"use_mrope": false,
|
| 29 |
"use_sliding_window": false,
|
| 30 |
"vocab_size": 151665
|
|
|
|
| 24 |
"tie_word_embeddings": true,
|
| 25 |
"torch_dtype": "bfloat16",
|
| 26 |
"transformers_version": "4.46.3",
|
| 27 |
+
"use_cache": false,
|
| 28 |
"use_mrope": false,
|
| 29 |
"use_sliding_window": false,
|
| 30 |
"vocab_size": 151665
|
train_results.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
| 2 |
"epoch": 0.9999813887699838,
|
| 3 |
"total_flos": 0.0,
|
| 4 |
"train_loss": 0.0,
|
| 5 |
-
"train_runtime":
|
| 6 |
"train_samples": 3438778,
|
| 7 |
-
"train_samples_per_second":
|
| 8 |
-
"train_steps_per_second":
|
| 9 |
}
|
|
|
|
| 2 |
"epoch": 0.9999813887699838,
|
| 3 |
"total_flos": 0.0,
|
| 4 |
"train_loss": 0.0,
|
| 5 |
+
"train_runtime": 20.8147,
|
| 6 |
"train_samples": 3438778,
|
| 7 |
+
"train_samples_per_second": 165208.979,
|
| 8 |
+
"train_steps_per_second": 1290.673
|
| 9 |
}
|
trainer_state.json
CHANGED
|
@@ -40398,9 +40398,9 @@
|
|
| 40398 |
"step": 26865,
|
| 40399 |
"total_flos": 0.0,
|
| 40400 |
"train_loss": 0.0,
|
| 40401 |
-
"train_runtime":
|
| 40402 |
-
"train_samples_per_second":
|
| 40403 |
-
"train_steps_per_second":
|
| 40404 |
}
|
| 40405 |
],
|
| 40406 |
"logging_steps": 10,
|
|
|
|
| 40398 |
"step": 26865,
|
| 40399 |
"total_flos": 0.0,
|
| 40400 |
"train_loss": 0.0,
|
| 40401 |
+
"train_runtime": 20.8147,
|
| 40402 |
+
"train_samples_per_second": 165208.979,
|
| 40403 |
+
"train_steps_per_second": 1290.673
|
| 40404 |
}
|
| 40405 |
],
|
| 40406 |
"logging_steps": 10,
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 7864
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dfa920440d870bd978c9bfc20c34f8c14db806f66ae160525b7d6434ab31f248
|
| 3 |
size 7864
|