Update README.md
Browse files
README.md
CHANGED
@@ -13,11 +13,70 @@ tags:
|
|
13 |
- sft
|
14 |
---
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
# Uploaded model
|
17 |
|
18 |
- **Developed by:** KingNish
|
19 |
- **License:** apache-2.0
|
20 |
-
- **Finetuned from model :**
|
21 |
|
22 |
This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
23 |
|
|
|
13 |
- sft
|
14 |
---
|
15 |
|
16 |
+
Here's a draft for a model page that you can use on Hugging Face for your trained model:
|
17 |
+
|
18 |
+
---
|
19 |
+
|
20 |
+
# Qwen 2.5 0.5B Model
|
21 |
+
|
22 |
+
## Model Description
|
23 |
+
|
24 |
+
This model is a compact yet powerful language model trained to answer a variety of questions with impressive quality. Despite its smaller size, it has demonstrated performance comparable to Llama 3.2 1B, and in some cases, it even outperforms it. This model was specifically trained on a 12,800 rows of the Magpie 300k Dataset.
|
25 |
+
|
26 |
+
## Performance
|
27 |
+
|
28 |
+
The Qwen 2.5 model has shown promising results in various tests, including the "strawberry test, Decimal Comparison test" where it successfully provided accurate answers. However, it is important to note that, like many models of its size, it may occasionally produce incorrect answers or flawed reasoning. Continuous improvements and full training are planned to enhance its performance further.
|
29 |
+
|
30 |
+
## How to Use
|
31 |
+
|
32 |
+
To use the Qwen 2.5 model, you can load it using the Hugging Face Transformers library. Here’s a simple example:
|
33 |
+
|
34 |
+
```python
|
35 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
36 |
+
|
37 |
+
model_name = "KingNish/Qwen2.5-0.5b-Test-ft"
|
38 |
+
|
39 |
+
model = AutoModelForCausalLM.from_pretrained(
|
40 |
+
model_name,
|
41 |
+
torch_dtype="auto",
|
42 |
+
device_map="auto"
|
43 |
+
)
|
44 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
45 |
+
|
46 |
+
prompt = "Which is greater 9.9 or 9.11 ??"
|
47 |
+
messages = [
|
48 |
+
{"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
|
49 |
+
{"role": "user", "content": prompt}
|
50 |
+
]
|
51 |
+
text = tokenizer.apply_chat_template(
|
52 |
+
messages,
|
53 |
+
tokenize=False,
|
54 |
+
add_generation_prompt=True
|
55 |
+
)
|
56 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
57 |
+
|
58 |
+
generated_ids = model.generate(
|
59 |
+
**model_inputs,
|
60 |
+
max_new_tokens=512
|
61 |
+
)
|
62 |
+
generated_ids = [
|
63 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
64 |
+
]
|
65 |
+
|
66 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
67 |
+
|
68 |
+
print(response)
|
69 |
+
```
|
70 |
+
|
71 |
+
## Future Work
|
72 |
+
|
73 |
+
I am actively working on improving the Qwen 2.5 model by training it on a larger dataset.
|
74 |
+
|
75 |
# Uploaded model
|
76 |
|
77 |
- **Developed by:** KingNish
|
78 |
- **License:** apache-2.0
|
79 |
+
- **Finetuned from model :** Qwen/Qwen2.5-0.5B-Instruct
|
80 |
|
81 |
This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
82 |
|