KingNish lbourdois commited on
Commit
e97f214
·
verified ·
1 Parent(s): 3737db2

Improve language tag (#1)

Browse files

- Improve language tag (02fc91304d2eff042b500fbecb1baf7b9b5c7c54)


Co-authored-by: Loïck BOURDOIS <[email protected]>

Files changed (1) hide show
  1. README.md +90 -78
README.md CHANGED
@@ -1,79 +1,91 @@
1
- ---
2
- base_model:
3
- - Qwen/Qwen2.5-0.5B-Instruct
4
- language:
5
- - en
6
- license: apache-2.0
7
- tags:
8
- - text-generation-inference
9
- - transformers
10
- - unsloth
11
- - qwen2
12
- - trl
13
- - sft
14
- ---
15
-
16
- # Qwen 2.5 0.5B Model
17
-
18
- ## Model Description
19
-
20
- 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.
21
-
22
- ## Performance
23
-
24
- 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.
25
-
26
- ## How to Use
27
-
28
- To use the Qwen 2.5 model, you can load it using the Hugging Face Transformers library. Here’s a simple example:
29
-
30
- ```python
31
- from transformers import AutoModelForCausalLM, AutoTokenizer
32
-
33
- model_name = "KingNish/Qwen2.5-0.5b-Test-ft"
34
-
35
- model = AutoModelForCausalLM.from_pretrained(
36
- model_name,
37
- torch_dtype="auto",
38
- device_map="auto"
39
- )
40
- tokenizer = AutoTokenizer.from_pretrained(model_name)
41
-
42
- prompt = "Which is greater 9.9 or 9.11 ??"
43
- messages = [
44
- {"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
45
- {"role": "user", "content": prompt}
46
- ]
47
- text = tokenizer.apply_chat_template(
48
- messages,
49
- tokenize=False,
50
- add_generation_prompt=True
51
- )
52
- model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
53
-
54
- generated_ids = model.generate(
55
- **model_inputs,
56
- max_new_tokens=512
57
- )
58
- generated_ids = [
59
- output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
60
- ]
61
-
62
- response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
63
-
64
- print(response)
65
- ```
66
-
67
- ## Future Work
68
-
69
- I am actively working on improving the Qwen 2.5 model by training it on a larger dataset.
70
-
71
- # Uploaded model
72
-
73
- - **Developed by:** KingNish
74
- - **License:** apache-2.0
75
- - **Finetuned from model :** Qwen/Qwen2.5-0.5B-Instruct
76
-
77
- This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
78
-
 
 
 
 
 
 
 
 
 
 
 
 
79
  [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
1
+ ---
2
+ base_model:
3
+ - Qwen/Qwen2.5-0.5B-Instruct
4
+ language:
5
+ - zho
6
+ - eng
7
+ - fra
8
+ - spa
9
+ - por
10
+ - deu
11
+ - ita
12
+ - rus
13
+ - jpn
14
+ - kor
15
+ - vie
16
+ - tha
17
+ - ara
18
+ license: apache-2.0
19
+ tags:
20
+ - text-generation-inference
21
+ - transformers
22
+ - unsloth
23
+ - qwen2
24
+ - trl
25
+ - sft
26
+ ---
27
+
28
+ # Qwen 2.5 0.5B Model
29
+
30
+ ## Model Description
31
+
32
+ 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.
33
+
34
+ ## Performance
35
+
36
+ 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.
37
+
38
+ ## How to Use
39
+
40
+ To use the Qwen 2.5 model, you can load it using the Hugging Face Transformers library. Here’s a simple example:
41
+
42
+ ```python
43
+ from transformers import AutoModelForCausalLM, AutoTokenizer
44
+
45
+ model_name = "KingNish/Qwen2.5-0.5b-Test-ft"
46
+
47
+ model = AutoModelForCausalLM.from_pretrained(
48
+ model_name,
49
+ torch_dtype="auto",
50
+ device_map="auto"
51
+ )
52
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
53
+
54
+ prompt = "Which is greater 9.9 or 9.11 ??"
55
+ messages = [
56
+ {"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
57
+ {"role": "user", "content": prompt}
58
+ ]
59
+ text = tokenizer.apply_chat_template(
60
+ messages,
61
+ tokenize=False,
62
+ add_generation_prompt=True
63
+ )
64
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
65
+
66
+ generated_ids = model.generate(
67
+ **model_inputs,
68
+ max_new_tokens=512
69
+ )
70
+ generated_ids = [
71
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
72
+ ]
73
+
74
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
75
+
76
+ print(response)
77
+ ```
78
+
79
+ ## Future Work
80
+
81
+ I am actively working on improving the Qwen 2.5 model by training it on a larger dataset.
82
+
83
+ # Uploaded model
84
+
85
+ - **Developed by:** KingNish
86
+ - **License:** apache-2.0
87
+ - **Finetuned from model :** Qwen/Qwen2.5-0.5B-Instruct
88
+
89
+ This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
90
+
91
  [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)