Text Generation
Transformers
Safetensors
qwen2
Generated from Trainer
trl
dpo
conversational
text-generation-inference
Instructions to use Death-Raider/DPO-Qwen with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Death-Raider/DPO-Qwen with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Death-Raider/DPO-Qwen") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Death-Raider/DPO-Qwen") model = AutoModelForCausalLM.from_pretrained("Death-Raider/DPO-Qwen") 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 Death-Raider/DPO-Qwen with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Death-Raider/DPO-Qwen" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Death-Raider/DPO-Qwen", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Death-Raider/DPO-Qwen
- SGLang
How to use Death-Raider/DPO-Qwen 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 "Death-Raider/DPO-Qwen" \ --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": "Death-Raider/DPO-Qwen", "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 "Death-Raider/DPO-Qwen" \ --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": "Death-Raider/DPO-Qwen", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Death-Raider/DPO-Qwen with Docker Model Runner:
docker model run hf.co/Death-Raider/DPO-Qwen
model updated
Browse files- README.md +3 -3
- config.json +1 -1
- generation_config.json +1 -1
- model-00001-of-00004.safetensors +1 -1
- model-00002-of-00004.safetensors +1 -1
- model-00003-of-00004.safetensors +1 -1
- model-00004-of-00004.safetensors +1 -1
- special_tokens_map.json +1 -7
- tokenizer_config.json +1 -1
- training_args.bin +1 -1
README.md
CHANGED
|
@@ -4,8 +4,8 @@ library_name: transformers
|
|
| 4 |
model_name: QwenModel_dpo
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
| 7 |
-
- dpo
|
| 8 |
- trl
|
|
|
|
| 9 |
licence: license
|
| 10 |
---
|
| 11 |
|
|
@@ -35,10 +35,10 @@ This model was trained with DPO, a method introduced in [Direct Preference Optim
|
|
| 35 |
### Framework versions
|
| 36 |
|
| 37 |
- TRL: 0.23.0
|
| 38 |
-
- Transformers: 4.56.
|
| 39 |
- Pytorch: 2.8.0.dev20250319+cu128
|
| 40 |
- Datasets: 4.1.1
|
| 41 |
-
- Tokenizers: 0.22.
|
| 42 |
|
| 43 |
## Citations
|
| 44 |
|
|
|
|
| 4 |
model_name: QwenModel_dpo
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
|
|
|
| 7 |
- trl
|
| 8 |
+
- dpo
|
| 9 |
licence: license
|
| 10 |
---
|
| 11 |
|
|
|
|
| 35 |
### Framework versions
|
| 36 |
|
| 37 |
- TRL: 0.23.0
|
| 38 |
+
- Transformers: 4.56.2
|
| 39 |
- Pytorch: 2.8.0.dev20250319+cu128
|
| 40 |
- Datasets: 4.1.1
|
| 41 |
+
- Tokenizers: 0.22.1
|
| 42 |
|
| 43 |
## Citations
|
| 44 |
|
config.json
CHANGED
|
@@ -51,7 +51,7 @@
|
|
| 51 |
"rope_theta": 1000000.0,
|
| 52 |
"sliding_window": null,
|
| 53 |
"tie_word_embeddings": false,
|
| 54 |
-
"transformers_version": "4.56.
|
| 55 |
"use_cache": true,
|
| 56 |
"use_sliding_window": false,
|
| 57 |
"vocab_size": 152064
|
|
|
|
| 51 |
"rope_theta": 1000000.0,
|
| 52 |
"sliding_window": null,
|
| 53 |
"tie_word_embeddings": false,
|
| 54 |
+
"transformers_version": "4.56.2",
|
| 55 |
"use_cache": true,
|
| 56 |
"use_sliding_window": false,
|
| 57 |
"vocab_size": 152064
|
generation_config.json
CHANGED
|
@@ -9,5 +9,5 @@
|
|
| 9 |
"temperature": 0.7,
|
| 10 |
"top_k": 20,
|
| 11 |
"top_p": 0.8,
|
| 12 |
-
"transformers_version": "4.56.
|
| 13 |
}
|
|
|
|
| 9 |
"temperature": 0.7,
|
| 10 |
"top_k": 20,
|
| 11 |
"top_p": 0.8,
|
| 12 |
+
"transformers_version": "4.56.2"
|
| 13 |
}
|
model-00001-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4877660776
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:adc6d07800dbb954f5ee36b7257cbc2a2aa526161b8940cd818cec0920b3369d
|
| 3 |
size 4877660776
|
model-00002-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4932751008
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b49f291cf1ca115dcb845b8f293aaeda0001486cf56fcf75eaa5559c50d34d0a
|
| 3 |
size 4932751008
|
model-00003-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4330865200
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d16e5c4f0e0ebd005dda6ec5ccee73510662e7145ec6c1699eed1045e7ccbec
|
| 3 |
size 4330865200
|
model-00004-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1089994880
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:62b045376cd6363b450a3bc3d37c90942f8c226f3fd60c4d660521c132b97b32
|
| 3 |
size 1089994880
|
special_tokens_map.json
CHANGED
|
@@ -21,11 +21,5 @@
|
|
| 21 |
"rstrip": false,
|
| 22 |
"single_word": false
|
| 23 |
},
|
| 24 |
-
"pad_token":
|
| 25 |
-
"content": "<|endoftext|>",
|
| 26 |
-
"lstrip": false,
|
| 27 |
-
"normalized": false,
|
| 28 |
-
"rstrip": false,
|
| 29 |
-
"single_word": false
|
| 30 |
-
}
|
| 31 |
}
|
|
|
|
| 21 |
"rstrip": false,
|
| 22 |
"single_word": false
|
| 23 |
},
|
| 24 |
+
"pad_token": "<|im_end|>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
}
|
tokenizer_config.json
CHANGED
|
@@ -200,7 +200,7 @@
|
|
| 200 |
"errors": "replace",
|
| 201 |
"extra_special_tokens": {},
|
| 202 |
"model_max_length": 131072,
|
| 203 |
-
"pad_token": "<|
|
| 204 |
"padding_side": "right",
|
| 205 |
"split_special_tokens": false,
|
| 206 |
"tokenizer_class": "Qwen2Tokenizer",
|
|
|
|
| 200 |
"errors": "replace",
|
| 201 |
"extra_special_tokens": {},
|
| 202 |
"model_max_length": 131072,
|
| 203 |
+
"pad_token": "<|im_end|>",
|
| 204 |
"padding_side": "right",
|
| 205 |
"split_special_tokens": false,
|
| 206 |
"tokenizer_class": "Qwen2Tokenizer",
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 6801
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:12122b9fdc78225f20c28a9cffc0e46a45aa91a2facc7e5e3735f047f27247a4
|
| 3 |
size 6801
|