Update README.md
Browse files
README.md
CHANGED
@@ -1,23 +1,227 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
-
base_model:
|
|
|
3 |
tags:
|
4 |
- text-generation-inference
|
5 |
- transformers
|
6 |
-
- unsloth
|
7 |
- qwen2
|
8 |
- trl
|
9 |
- sft
|
10 |
license: apache-2.0
|
11 |
language:
|
12 |
- en
|
|
|
|
|
|
|
13 |
---
|
14 |
|
15 |
# Uploaded model
|
16 |
|
17 |
- **Developed by:** beyoru
|
18 |
- **License:** apache-2.0
|
19 |
-
- **Finetuned from model :** unsloth/Qwen2.5-3B-Instruct
|
20 |
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Hugging Face's logo
|
2 |
+
Hugging Face
|
3 |
+
Search models, datasets, users...
|
4 |
+
Models
|
5 |
+
Datasets
|
6 |
+
Spaces
|
7 |
+
Posts
|
8 |
+
Docs
|
9 |
+
Enterprise
|
10 |
+
Pricing
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
+
beyoru
|
16 |
+
/
|
17 |
+
MCQ-o1-1
|
18 |
+
|
19 |
+
like
|
20 |
+
0
|
21 |
+
Text Generation
|
22 |
+
Transformers
|
23 |
+
PyTorch
|
24 |
+
|
25 |
+
beyoru/Tin_hoc_mcq
|
26 |
+
English
|
27 |
+
Vietnamese
|
28 |
+
qwen2
|
29 |
+
text-generation-inference
|
30 |
+
trl
|
31 |
+
sft
|
32 |
+
conversational
|
33 |
+
Inference Endpoints
|
34 |
+
|
35 |
+
License:
|
36 |
+
apache-2.0
|
37 |
+
Model card
|
38 |
+
Files and versions
|
39 |
+
Community
|
40 |
+
Settings
|
41 |
+
MCQ-o1-1/
|
42 |
+
README.md
|
43 |
+
Metadata UI
|
44 |
+
license
|
45 |
+
|
46 |
+
|
47 |
+
datasets
|
48 |
+
|
49 |
+
|
50 |
+
+ Add Datasets
|
51 |
+
language
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
+ Add Languages
|
56 |
+
metrics
|
57 |
+
|
58 |
+
+ Add Metrics
|
59 |
+
base_model
|
60 |
+
|
61 |
+
|
62 |
+
+ Add Base Model
|
63 |
+
new_version
|
64 |
+
|
65 |
+
+ Add New Version
|
66 |
+
pipeline_tag
|
67 |
+
|
68 |
+
|
69 |
+
Auto-detected
|
70 |
+
library_name
|
71 |
+
|
72 |
+
+ Add Library
|
73 |
+
tags
|
74 |
+
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
|
80 |
+
+ Add Tags
|
81 |
+
Eval Results
|
82 |
+
|
83 |
+
View doc
|
84 |
+
|
85 |
+
1
|
86 |
+
2
|
87 |
+
3
|
88 |
+
4
|
89 |
+
5
|
90 |
+
6
|
91 |
+
7
|
92 |
+
8
|
93 |
+
9
|
94 |
+
10
|
95 |
+
11
|
96 |
+
12
|
97 |
+
13
|
98 |
+
14
|
99 |
+
15
|
100 |
+
16
|
101 |
+
17
|
102 |
+
18
|
103 |
+
19
|
104 |
+
20
|
105 |
+
21
|
106 |
+
22
|
107 |
+
23
|
108 |
+
24
|
109 |
+
25
|
110 |
+
26
|
111 |
+
27
|
112 |
+
28
|
113 |
+
29
|
114 |
+
30
|
115 |
+
31
|
116 |
+
32
|
117 |
+
33
|
118 |
+
34
|
119 |
+
35
|
120 |
+
36
|
121 |
+
37
|
122 |
+
38
|
123 |
+
39
|
124 |
+
40
|
125 |
+
41
|
126 |
+
42
|
127 |
+
43
|
128 |
+
44
|
129 |
+
45
|
130 |
+
46
|
131 |
+
47
|
132 |
+
48
|
133 |
+
49
|
134 |
+
50
|
135 |
+
51
|
136 |
+
52
|
137 |
+
53
|
138 |
+
54
|
139 |
+
55
|
140 |
+
56
|
141 |
+
57
|
142 |
+
58
|
143 |
+
59
|
144 |
+
60
|
145 |
+
61
|
146 |
+
62
|
147 |
+
⌄
|
148 |
+
⌄
|
149 |
+
⌄
|
150 |
+
⌄
|
151 |
+
⌄
|
152 |
+
⌄
|
153 |
+
⌄
|
154 |
+
⌄
|
155 |
+
⌄
|
156 |
---
|
157 |
+
base_model:
|
158 |
+
- Qwen/Qwen2.5-3B-Instruct
|
159 |
tags:
|
160 |
- text-generation-inference
|
161 |
- transformers
|
|
|
162 |
- qwen2
|
163 |
- trl
|
164 |
- sft
|
165 |
license: apache-2.0
|
166 |
language:
|
167 |
- en
|
168 |
+
- vi
|
169 |
+
datasets:
|
170 |
+
- beyoru/Tin_hoc_mcq
|
171 |
---
|
172 |
|
173 |
# Uploaded model
|
174 |
|
175 |
- **Developed by:** beyoru
|
176 |
- **License:** apache-2.0
|
|
|
177 |
|
178 |
+
# Usage
|
179 |
+
```
|
180 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
181 |
+
|
182 |
+
model_name = "beyoru/MCQ-3B-o1-1"
|
183 |
+
|
184 |
+
model = AutoModelForCausalLM.from_pretrained(
|
185 |
+
model_name,
|
186 |
+
torch_dtype="auto",
|
187 |
+
device_map="auto"
|
188 |
+
)
|
189 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
190 |
+
|
191 |
+
messages = [
|
192 |
+
{"role": "system", "content": "Tạo một câu hỏi trắc nghiệm về"},
|
193 |
+
{"role": "user", "content": "<YOUR CONTEXT>"}
|
194 |
+
]
|
195 |
+
text = tokenizer.apply_chat_template(
|
196 |
+
messages,
|
197 |
+
tokenize=False,
|
198 |
+
add_generation_prompt=True
|
199 |
+
)
|
200 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
201 |
+
|
202 |
+
generated_ids = model.generate(
|
203 |
+
**model_inputs,
|
204 |
+
do_sample=True
|
205 |
+
)
|
206 |
+
generated_ids = [
|
207 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
208 |
+
]
|
209 |
+
|
210 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
211 |
+
```
|
212 |
|
213 |
+
# Notes:
|
214 |
+
- For small datasets with narrow content which the model has already done well on our domain, and doesn't want the model to forget the knowledge => Just need to focus on q,v.
|
215 |
+
- Fine-tuned lora with rank = 8 and alpha = 16, epoch = 1, linear (optim)
|
216 |
+
- DoRA
|
217 |
+
|
218 |
+
Commit directly to the
|
219 |
+
main
|
220 |
+
branch
|
221 |
+
Open as a pull request to the
|
222 |
+
main
|
223 |
+
branch
|
224 |
+
Commit changes
|
225 |
+
Update README.md
|
226 |
+
Add an extended description...
|
227 |
+
Upload images, audio, and videos by dragging in the text input, pasting, or clicking here.
|