Kendamarron
commited on
Commit
•
63d42a4
1
Parent(s):
222fdc8
Update README.md
Browse files
README.md
CHANGED
@@ -11,16 +11,66 @@ model-index:
|
|
11 |
results: []
|
12 |
language:
|
13 |
- ja
|
|
|
|
|
|
|
14 |
---
|
15 |
|
16 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
17 |
should probably proofread and complete it, then remove this comment. -->
|
18 |
|
19 |
-
#
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
## Model description
|
26 |
|
|
|
11 |
results: []
|
12 |
language:
|
13 |
- ja
|
14 |
+
datasets:
|
15 |
+
- Kendamarron/Magpie-Tanuki-8B-CoT
|
16 |
+
- Kendamarron/OpenMathInstruct-2-ja-CoT
|
17 |
---
|
18 |
|
19 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
20 |
should probably proofread and complete it, then remove this comment. -->
|
21 |
|
22 |
+
# Model
|
23 |
|
24 |
+
[llm-jp/llm-jp-3-3.7b-instruct](https://huggingface.co/llm-jp/llm-jp-3-3.7b-instruct)をCoTデータでファインチューニングすることで作成したreasoningモデルです。
|
25 |
+
|
26 |
+
学習にはQwen2.5-32B-Instruct-AWQを使って生成した合成データセットを使用しています。.
|
27 |
+
|
28 |
+
- [Kendamarron/llm-jp-3-3.7b-o1-v0.1](https://huggingface.co/datasets/Kendamarron/Magpie-Tanuki-8B-CoT)
|
29 |
+
- [Kendamarron/OpenMathInstruct-2-ja-CoT](https://huggingface.co/datasets/Kendamarron/OpenMathInstruct-2-ja-CoT)
|
30 |
+
|
31 |
+
## Usage
|
32 |
+
```
|
33 |
+
import torch
|
34 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
35 |
+
|
36 |
+
device = "cuda"
|
37 |
+
|
38 |
+
model = AutoModelForCausalLM.from_pretrained(
|
39 |
+
'Kendamarron/llm-jp-3-3.7b-o1-v0.1',
|
40 |
+
torch_dtype=torch.bfloat16,
|
41 |
+
device_map=device,
|
42 |
+
)
|
43 |
+
tokenizer = AutoTokenizer.from_pretrained('Kendamarron/Tokara-0.5B-Chat-dolly-jimba')
|
44 |
+
|
45 |
+
messages = [
|
46 |
+
{"role": "system", "content": "あなたは優秀で論理的なアシスタントです。まずは<Thought></Thought>タグの中であなたの思考の過程を記載し、<Output></Output>タグの中に最終的にユーザーに提供する出力を記載します。"},
|
47 |
+
{"role": "user", "content": "1から10までの整数を足すと?"}
|
48 |
+
]
|
49 |
+
text = tokenizer.apply_chat_template(
|
50 |
+
messages,
|
51 |
+
tokenize=False,
|
52 |
+
add_generation_prompt=True
|
53 |
+
)
|
54 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(device)
|
55 |
+
generated_ids = model.generate(
|
56 |
+
model_inputs.input_ids,
|
57 |
+
max_new_tokens=256,
|
58 |
+
do_sample=True,
|
59 |
+
top_p=0.95,
|
60 |
+
top_k=40,
|
61 |
+
temperature=0.7,
|
62 |
+
repetition_penalty=1.1,
|
63 |
+
pad_token_id=tokenizer.eos_token_id,
|
64 |
+
eos_token_id=tokenizer.eos_token_id,
|
65 |
+
no_repeat_ngram_size=2
|
66 |
+
)
|
67 |
+
generated_ids = [
|
68 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
69 |
+
]
|
70 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
71 |
+
|
72 |
+
print(response)
|
73 |
+
```
|
74 |
|
75 |
## Model description
|
76 |
|