Text Generation
Transformers
Safetensors
English
qwen2
Generated from Trainer
sft
ultrafeedback
conversational
text-generation-inference
Instructions to use activeDap/Qwen1.5-1.8B_ultrafeedback_chosen with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use activeDap/Qwen1.5-1.8B_ultrafeedback_chosen with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="activeDap/Qwen1.5-1.8B_ultrafeedback_chosen") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("activeDap/Qwen1.5-1.8B_ultrafeedback_chosen") model = AutoModelForCausalLM.from_pretrained("activeDap/Qwen1.5-1.8B_ultrafeedback_chosen") 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 activeDap/Qwen1.5-1.8B_ultrafeedback_chosen with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "activeDap/Qwen1.5-1.8B_ultrafeedback_chosen" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "activeDap/Qwen1.5-1.8B_ultrafeedback_chosen", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/activeDap/Qwen1.5-1.8B_ultrafeedback_chosen
- SGLang
How to use activeDap/Qwen1.5-1.8B_ultrafeedback_chosen 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 "activeDap/Qwen1.5-1.8B_ultrafeedback_chosen" \ --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": "activeDap/Qwen1.5-1.8B_ultrafeedback_chosen", "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 "activeDap/Qwen1.5-1.8B_ultrafeedback_chosen" \ --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": "activeDap/Qwen1.5-1.8B_ultrafeedback_chosen", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use activeDap/Qwen1.5-1.8B_ultrafeedback_chosen with Docker Model Runner:
docker model run hf.co/activeDap/Qwen1.5-1.8B_ultrafeedback_chosen
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +88 -0
- added_tokens.json +5 -0
- all_results.json +7 -0
- chat_template.jinja +6 -0
- config.json +54 -0
- generation_config.json +8 -0
- loss_plot.png +0 -0
- merges.txt +0 -0
- model.safetensors +3 -0
- special_tokens_map.json +20 -0
- tokenizer.json +3 -0
- tokenizer_config.json +43 -0
- train_results.json +7 -0
- training_args.bin +3 -0
- vocab.json +0 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen1.5-1.8B
|
| 4 |
+
tags:
|
| 5 |
+
- generated_from_trainer
|
| 6 |
+
- sft
|
| 7 |
+
- ultrafeedback
|
| 8 |
+
datasets:
|
| 9 |
+
- activeDap/ultrafeedback_chosen
|
| 10 |
+
language:
|
| 11 |
+
- en
|
| 12 |
+
library_name: transformers
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Qwen1.5-1.8B Fine-tuned on ultrafeedback_chosen
|
| 16 |
+
|
| 17 |
+
This model is a fine-tuned version of [Qwen/Qwen1.5-1.8B](https://huggingface.co/Qwen/Qwen1.5-1.8B) on the [activeDap/ultrafeedback_chosen](https://huggingface.co/datasets/activeDap/ultrafeedback_chosen) dataset.
|
| 18 |
+
|
| 19 |
+
## Training Results
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
|
| 23 |
+
### Training Statistics
|
| 24 |
+
|
| 25 |
+
| Metric | Value |
|
| 26 |
+
|--------|-------|
|
| 27 |
+
| Total Steps | 816 |
|
| 28 |
+
| Final Training Loss | 1.5145 |
|
| 29 |
+
| Min Training Loss | 1.5145 |
|
| 30 |
+
| Training Runtime | 263.04 seconds |
|
| 31 |
+
| Samples/Second | 198.53 |
|
| 32 |
+
|
| 33 |
+
## Training Configuration
|
| 34 |
+
|
| 35 |
+
| Parameter | Value |
|
| 36 |
+
|-----------|-------|
|
| 37 |
+
| Base Model | Qwen/Qwen1.5-1.8B |
|
| 38 |
+
| Dataset | activeDap/ultrafeedback_chosen |
|
| 39 |
+
| Number of Epochs | 1.0 |
|
| 40 |
+
| Per Device Batch Size | 16 |
|
| 41 |
+
| Gradient Accumulation Steps | 1 |
|
| 42 |
+
| Total Batch Size | 64 (4 GPUs) |
|
| 43 |
+
| Learning Rate | 2e-05 |
|
| 44 |
+
| LR Scheduler | cosine |
|
| 45 |
+
| Warmup Ratio | 0.1 |
|
| 46 |
+
| Max Sequence Length | 512 |
|
| 47 |
+
| Optimizer | adamw_torch_fused |
|
| 48 |
+
| Mixed Precision | BF16 |
|
| 49 |
+
|
| 50 |
+
## Usage
|
| 51 |
+
|
| 52 |
+
```python
|
| 53 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 54 |
+
|
| 55 |
+
model_name = "activeDap/Qwen1.5-1.8B_ultrafeedback_chosen"
|
| 56 |
+
|
| 57 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 58 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 59 |
+
|
| 60 |
+
# Format input with prompt template
|
| 61 |
+
prompt = "What is machine learning?\nAssistant:"
|
| 62 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 63 |
+
|
| 64 |
+
# Generate response
|
| 65 |
+
outputs = model.generate(**inputs, max_new_tokens=100)
|
| 66 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 67 |
+
print(response)
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
## Training Framework
|
| 71 |
+
|
| 72 |
+
- **Library:** Transformers + TRL
|
| 73 |
+
- **Training Type:** Supervised Fine-Tuning (SFT)
|
| 74 |
+
- **Format:** Prompt-completion with Assistant-only loss
|
| 75 |
+
|
| 76 |
+
## Citation
|
| 77 |
+
|
| 78 |
+
If you use this model, please cite the original base model and dataset:
|
| 79 |
+
|
| 80 |
+
```bibtex
|
| 81 |
+
@misc{ultrafeedback2023,
|
| 82 |
+
title={UltraFeedback: Boosting Language Models with High-quality Feedback},
|
| 83 |
+
author={Ganqu Cui and Lifan Yuan and Ning Ding and others},
|
| 84 |
+
year={2023},
|
| 85 |
+
eprint={2310.01377},
|
| 86 |
+
archivePrefix={arXiv}
|
| 87 |
+
}
|
| 88 |
+
```
|
added_tokens.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"<|endoftext|>": 151643,
|
| 3 |
+
"<|im_end|>": 151645,
|
| 4 |
+
"<|im_start|>": 151644
|
| 5 |
+
}
|
all_results.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"total_flos": 2.4476548106236723e+17,
|
| 3 |
+
"train_loss": 1.5669958942076738,
|
| 4 |
+
"train_runtime": 263.0433,
|
| 5 |
+
"train_samples_per_second": 198.534,
|
| 6 |
+
"train_steps_per_second": 3.102
|
| 7 |
+
}
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system
|
| 2 |
+
You are a helpful assistant<|im_end|>
|
| 3 |
+
' }}{% endif %}{{'<|im_start|>' + message['role'] + '
|
| 4 |
+
' + message['content'] + '<|im_end|>' + '
|
| 5 |
+
'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
|
| 6 |
+
' }}{% endif %}
|
config.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"dtype": "bfloat16",
|
| 7 |
+
"eos_token_id": 151643,
|
| 8 |
+
"hidden_act": "silu",
|
| 9 |
+
"hidden_size": 2048,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"intermediate_size": 5504,
|
| 12 |
+
"layer_types": [
|
| 13 |
+
"full_attention",
|
| 14 |
+
"full_attention",
|
| 15 |
+
"full_attention",
|
| 16 |
+
"full_attention",
|
| 17 |
+
"full_attention",
|
| 18 |
+
"full_attention",
|
| 19 |
+
"full_attention",
|
| 20 |
+
"full_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"full_attention",
|
| 23 |
+
"full_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"full_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention"
|
| 37 |
+
],
|
| 38 |
+
"max_position_embeddings": 32768,
|
| 39 |
+
"max_window_layers": 21,
|
| 40 |
+
"model_type": "qwen2",
|
| 41 |
+
"num_attention_heads": 16,
|
| 42 |
+
"num_hidden_layers": 24,
|
| 43 |
+
"num_key_value_heads": 16,
|
| 44 |
+
"pad_token_id": 151643,
|
| 45 |
+
"rms_norm_eps": 1e-06,
|
| 46 |
+
"rope_scaling": null,
|
| 47 |
+
"rope_theta": 1000000.0,
|
| 48 |
+
"sliding_window": null,
|
| 49 |
+
"tie_word_embeddings": false,
|
| 50 |
+
"transformers_version": "4.57.1",
|
| 51 |
+
"use_cache": false,
|
| 52 |
+
"use_sliding_window": false,
|
| 53 |
+
"vocab_size": 151936
|
| 54 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"eos_token_id": [
|
| 3 |
+
151643
|
| 4 |
+
],
|
| 5 |
+
"max_new_tokens": 2048,
|
| 6 |
+
"pad_token_id": 151643,
|
| 7 |
+
"transformers_version": "4.57.1"
|
| 8 |
+
}
|
loss_plot.png
ADDED
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:df788e0a1a2ae8b307c17eca0c6af9c6643176f12a1d83e47d1ba9bc805a07da
|
| 3 |
+
size 3673690696
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
"<|im_start|>",
|
| 4 |
+
"<|im_end|>"
|
| 5 |
+
],
|
| 6 |
+
"eos_token": {
|
| 7 |
+
"content": "<|endoftext|>",
|
| 8 |
+
"lstrip": false,
|
| 9 |
+
"normalized": false,
|
| 10 |
+
"rstrip": false,
|
| 11 |
+
"single_word": false
|
| 12 |
+
},
|
| 13 |
+
"pad_token": {
|
| 14 |
+
"content": "<|endoftext|>",
|
| 15 |
+
"lstrip": false,
|
| 16 |
+
"normalized": false,
|
| 17 |
+
"rstrip": false,
|
| 18 |
+
"single_word": false
|
| 19 |
+
}
|
| 20 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bcfe42da0a4497e8b2b172c1f9f4ec423a46dc12907f4349c55025f670422ba9
|
| 3 |
+
size 11418266
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"added_tokens_decoder": {
|
| 4 |
+
"151643": {
|
| 5 |
+
"content": "<|endoftext|>",
|
| 6 |
+
"lstrip": false,
|
| 7 |
+
"normalized": false,
|
| 8 |
+
"rstrip": false,
|
| 9 |
+
"single_word": false,
|
| 10 |
+
"special": true
|
| 11 |
+
},
|
| 12 |
+
"151644": {
|
| 13 |
+
"content": "<|im_start|>",
|
| 14 |
+
"lstrip": false,
|
| 15 |
+
"normalized": false,
|
| 16 |
+
"rstrip": false,
|
| 17 |
+
"single_word": false,
|
| 18 |
+
"special": true
|
| 19 |
+
},
|
| 20 |
+
"151645": {
|
| 21 |
+
"content": "<|im_end|>",
|
| 22 |
+
"lstrip": false,
|
| 23 |
+
"normalized": false,
|
| 24 |
+
"rstrip": false,
|
| 25 |
+
"single_word": false,
|
| 26 |
+
"special": true
|
| 27 |
+
}
|
| 28 |
+
},
|
| 29 |
+
"additional_special_tokens": [
|
| 30 |
+
"<|im_start|>",
|
| 31 |
+
"<|im_end|>"
|
| 32 |
+
],
|
| 33 |
+
"bos_token": null,
|
| 34 |
+
"clean_up_tokenization_spaces": false,
|
| 35 |
+
"eos_token": "<|endoftext|>",
|
| 36 |
+
"errors": "replace",
|
| 37 |
+
"extra_special_tokens": {},
|
| 38 |
+
"model_max_length": 32768,
|
| 39 |
+
"pad_token": "<|endoftext|>",
|
| 40 |
+
"split_special_tokens": false,
|
| 41 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 42 |
+
"unk_token": null
|
| 43 |
+
}
|
train_results.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"total_flos": 2.4476548106236723e+17,
|
| 3 |
+
"train_loss": 1.5669958942076738,
|
| 4 |
+
"train_runtime": 263.0433,
|
| 5 |
+
"train_samples_per_second": 198.534,
|
| 6 |
+
"train_steps_per_second": 3.102
|
| 7 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:86ef4ad72a24e0171b988c023a5219ba0c5684700e887af4f29b26b433501164
|
| 3 |
+
size 6161
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|