ptrdvn commited on
Commit
3e738a9
·
verified ·
1 Parent(s): 86ed85c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +142 -24
README.md CHANGED
@@ -11,9 +11,11 @@ base_model:
11
  - Qwen/Qwen2.5-7B-Instruct
12
  ---
13
 
14
- [日本語モデルカード](#japanese)
15
 
16
- [日本語のブログ]()
 
 
17
 
18
  # Karasu-DPO-7B
19
 
@@ -23,12 +25,14 @@ This model outperforms the base [Qwen/Qwen2.5-7B-Instruct](https://huggingface.c
23
 
24
  |Qwen2.5-7B-Instruct|Karasu-DPO-7B|
25
  |----|----|
26
- |50.0|56.6|
27
 
28
- We recommend this model for use as a general conversatio AI.
29
 
30
  # How to use
31
 
 
 
32
  <ul>
33
  <li><b>vLLM</b>
34
 
@@ -46,16 +50,14 @@ llm = LLM(
46
  )
47
 
48
  sampling_params = SamplingParams(
49
- temperature=0.5,
50
  max_tokens=8_000,
51
- repetition_penalty=1.1
52
  )
53
 
54
  prompts = [
55
- """学校には1クラスにつき20人の生徒がおり、クラスは合計3つあります。
56
- 学校全体では男子と女子がそれぞれ50%ずついます。
57
- 1つ目のクラスには女子が15人、2つ目のクラスには女子が12人います。
58
- 3つ目のクラスには何人の男子がいますか?"""
59
  ]
60
 
61
  conversations = [
@@ -66,32 +68,136 @@ outputs = llm.chat(conversations, sampling_params=sampling_params)
66
 
67
  for output in outputs:
68
  print(output.outputs[0].text)
 
69
 
70
- <think>
71
- # まず、学校の総生徒数を算出します。各クラスに20人の生徒があり、クラスは3つあるため、総生徒数は60人です。
 
 
 
72
 
73
- # 次に、学校全体で男子と女子は同じ人数で分布しています。したがって、男子と女子各有30人。
74
- ...
75
- # したがって、3つ目のクラスの男子数は20 - 3 = 17人です。
76
- # </think>
77
 
78
- # **解答:**
 
79
 
80
- # 学校の総生徒数を算出します。
81
- ...
82
- # **最終的な答え:**
83
- # \[
84
- # \boxed{17}
85
- # \]
86
  ```
87
 
88
  </details>
89
 
90
  <br/>
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  <h1 style="font-size: 48px;" id="japanese">日本語</h3>
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
 
96
  ### Model Details
97
  - Model size: 7B
@@ -117,4 +223,16 @@ for output in outputs:
117
  |70|0.462300| 0.506989|
118
  |80|0.419600| 0.509142|
119
  |90|0.445200| 0.510396|
120
- |100|0.424400| 0.511653|
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  - Qwen/Qwen2.5-7B-Instruct
12
  ---
13
 
14
+ [日本語モデルカード/Japanese model card](#japanese)
15
 
16
+ [日本語のブログ/Full Japanese dev blog]()
17
+
18
+ [Development source code/開発ソースコード]()
19
 
20
  # Karasu-DPO-7B
21
 
 
25
 
26
  |Qwen2.5-7B-Instruct|Karasu-DPO-7B|
27
  |----|----|
28
+ |50.0|66.2|
29
 
30
+ We recommend this model for use as a general conversation AI.
31
 
32
  # How to use
33
 
34
+ This model can be used in the same way as any Qwen 2.5 model. We recommend using vLLM for simplicity and speed.
35
+
36
  <ul>
37
  <li><b>vLLM</b>
38
 
 
50
  )
51
 
52
  sampling_params = SamplingParams(
53
+ temperature=0.0,
54
  max_tokens=8_000,
 
55
  )
56
 
57
  prompts = [
58
+ """ナイジェリアの首都はどこですか?""",
59
+ """鉄は何度に溶けますか?""",
60
+ """父が好きそうなプレゼントのおすすめを教えて""",
 
61
  ]
62
 
63
  conversations = [
 
68
 
69
  for output in outputs:
70
  print(output.outputs[0].text)
71
+ print("-"*32)
72
 
73
+ # ナイジェリアの首都はアブジャ(Abuja)です。以前はラゴスが首都でしたが、1991年に新しい首都としてアブジャが建設され、1991年12月12日に首都としての地位を正式に取得しました。アブジャは政治中心地として機能していますが、経済の中心地は依然としてラゴスが占めています。
74
+ # --------------------------------
75
+ # 鉄は非常に高い温度で溶けます。鉄の融点は約1,538℃(2,800°F)です。これは、一般的な家庭用のオーブン(最大約200-300℃)では絶対に達成できません。鉄を溶かすためには、より高温の設備が必要で、例えば、電気炉やガス炉などがあります。
76
+ # --------------------------------
77
+ # もちろんです。父さんへのプレゼント選びは楽しみですね。以下に、父が喜ぶ2つのプレゼントを提案します:
78
 
79
+ # 1. **高級コーヒーメーカー**:
80
+ # - 父さんがコーヒーを愛飲しているなら、高品質なコーヒーメーカーは大変喜ばれるプレゼントです。例えば、手動式のコーヒーメーカーなら、毎日のコーヒー作りがより楽しく、手作り感も楽しめます。また、自動式のコーヒーメーカーなら、忙しい朝でも美味しいコーヒーが楽しめます。
 
 
81
 
82
+ # 2. **趣味に合わせたギフトセット**:
83
+ # - 父さんの趣味や興味に合わせたギフトセットは、とても喜ばれます。例えば、ゴルフ好きなら、最新のゴルフクラブやゴルフバッグ、ゴルフボールセットなどが良いでしょう。また、車好きなら、高品質な車用アクセサリー(カーフィルム、カーボンシートなど)や車載用の充電器などが喜ばれます。
84
 
85
+ # これらのプレゼントは、父さんの趣味や興味に合わせて選べば、きっと喜んでもらえることでしょう。
86
+ # --------------------------------
 
 
 
 
87
  ```
88
 
89
  </details>
90
 
91
  <br/>
92
 
93
+ # How this model was made
94
+
95
+ We made this model through the following procedure:
96
+
97
+ 1. Sample Japanese and English prompts from the following datasets:
98
+ * lmsys/lmsys-chat-1m
99
+ * RyokoAI/ShareGPT52K
100
+ * openchat/openchat_sharegpt_v3
101
+ * OpenAssistant/oasst2
102
+ * Open-Orca/slimorca-deduped-cleaned-corrected
103
+ * HuggingFaceH4/ultrachat_200k
104
+ 2. Translate English prompts to Japanese using [gpt-4o-mini](https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/).
105
+ 3. Correct translations with [gpt-4o-mini](https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/).
106
+ 4. Get responses to all Japanese prompts (both original and translated) with [gpt-4o-mini](https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/).
107
+ 5. Correct responses using [gpt-4o-mini](https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/).
108
+
109
+ We QLoRA DPO trained a [Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct) model on this data to create Karasu-DPO-7B.
110
+
111
  <h1 style="font-size: 48px;" id="japanese">日本語</h3>
112
 
113
+ こちらのモデルは[Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct)の日本語版です。生成した日本語会話データとDPO学習で作成しました。
114
+
115
+ このモデルは、[arena-hard-auto-multilingual](https://github.com/lightblue-tech/arena-hard-auto-multilingual)チャットベンチマークにおいて、ベースモデルである[Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct)を上回る性能を発揮します:
116
+
117
+ |Qwen2.5-7B-Instruct|Karasu-DPO-7B|
118
+ |----|----|
119
+ |50.0|66.2|
120
+
121
+ このモデルは、一般的な会話AIとしての使用を推奨します。
122
+
123
+ # 使用方法
124
+
125
+ このモデルは、他のQwen 2.5モデルと同様の方法で使用できます。シンプルで高速な操作のためにはvLLMの使用を推奨します。
126
+
127
+ <ul>
128
+ <li><b>vLLM</b>
129
+
130
+ [vLLM](https://github.com/vllm-project/vllm/)を`pip install vllm`でインストールしてください。
131
+
132
+ <details open>
133
+ <summary>vLLMコードを見る</summary>
134
+
135
+ ```python
136
+ from vllm import LLM, SamplingParams
137
+
138
+ llm = LLM(
139
+ model="lightblue/DeepSeek-R1-Distill-Qwen-7B-Japanese",
140
+ max_model_len=8_000
141
+ )
142
+
143
+ sampling_params = SamplingParams(
144
+ temperature=0.0,
145
+ max_tokens=8_000,
146
+ )
147
+
148
+ prompts = [
149
+ """ナイジェリアの首都はどこですか?""",
150
+ """鉄は何度に溶けますか?""",
151
+ """父が好きそうなプレゼントのおすすめを教えて""",
152
+ ]
153
+
154
+ conversations = [
155
+ [{"role": "user", "content": x}] for x in prompts
156
+ ]
157
+
158
+ outputs = llm.chat(conversations, sampling_params=sampling_params)
159
+
160
+ for output in outputs:
161
+ print(output.outputs[0].text)
162
+ print("-"*32)
163
+
164
+ # ナイジェリアの首都はアブジャ(Abuja)です。以前はラゴスが首都でしたが、1991年に新しい首都としてアブジャが建設され、1991年12月12日に首都としての地位を正式に取得しました。アブジャは政治中心地として機能していますが、経済の中心地は依然としてラゴスが占めています。
165
+ # --------------------------------
166
+ # 鉄は非常に高い温度で溶けます。鉄の融点は約1,538℃(2,800°F)です。これは、一般的な家庭用のオーブン(最大約200-300℃)では絶対に達成できません。鉄を溶かすためには、より高温の設備が必要で、例えば、電気炉やガス炉などがあります。
167
+ # --------------------------------
168
+ # もちろんです。父さんへのプレゼント選びは楽しみですね。以下に、父が喜ぶ2つのプレゼントを提案します:
169
+
170
+ # 1. **高級コーヒーメーカー**:
171
+ # - 父さんがコーヒーを愛飲しているなら、高品質なコーヒーメーカーは大変喜ばれるプレゼントです。例えば、手動式のコーヒーメーカーなら、毎日のコーヒー作りがより楽しく、手作り感も楽しめます。また、自動式のコーヒーメーカーなら、忙しい朝でも美味しいコーヒーが楽しめます。
172
 
173
+ # 2. **趣味に合わせたギフトセット**:
174
+ # - 父さんの趣味や興味に合わせたギフトセットは、とても喜ばれます。例えば、ゴルフ好きなら、最新のゴルフクラブやゴルフバッグ、ゴルフボールセットなどが良いでしょう。また、車好きなら、高品質な車用アクセサリー(カーフィルム、カーボンシートなど)や車載用の充電器などが喜ばれます。
175
+
176
+ # これらのプレゼントは、父さんの趣味や興味に合わせて選べば、きっと喜んでもらえることでしょう。
177
+ # --------------------------------
178
+ ```
179
+
180
+ </details>
181
+
182
+ <br/>
183
+
184
+ # このモデルの作成方法
185
+
186
+ このモデルは以下の手順を通して作成されました:
187
+
188
+ 1. 以下のデータセットから日本語および英語のプロンプトをサンプリング:
189
+ * lmsys/lmsys-chat-1m
190
+ * RyokoAI/ShareGPT52K
191
+ * openchat/openchat_sharegpt_v3
192
+ * OpenAssistant/oasst2
193
+ * Open-Orca/slimorca-deduped-cleaned-corrected
194
+ * HuggingFaceH4/ultrachat_200k
195
+ 2. 英語のプロンプトを[gpt-4o-mini](https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/)を使って日本語に翻訳。
196
+ 3. [gpt-4o-mini](https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/)を使って翻訳を修正。
197
+ 4. 日本語のプロンプト(オリジナルと翻訳の両方)に対する応答を[gpt-4o-mini](https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/)で取得。
198
+ 5. [gpt-4o-mini](https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/)を使用して応答を修正。
199
+
200
+ [Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct)モデルを基に、QLoRA DPOトレーニングを行い、Karasu-DPO-7Bを作成しました。
201
 
202
  ### Model Details
203
  - Model size: 7B
 
223
  |70|0.462300| 0.506989|
224
  |80|0.419600| 0.509142|
225
  |90|0.445200| 0.510396|
226
+ |100|0.424400| 0.511653|
227
+
228
+ # License
229
+
230
+ We share this model under an Apache 2.0 license.
231
+
232
+ # Developed by
233
+
234
+ <a href="https://www.lightblue-tech.com">
235
+ <img src="https://www.lightblue-tech.com/wp-content/uploads/2023/08/color_%E6%A8%AA%E5%9E%8B-1536x469.png" alt="Lightblue technology logo" width="400"/>
236
+ </a>
237
+
238
+ This model was trained by Jun Sashihara ([junsashihara](https://huggingface.co/junsashihara)) and supervised by Peter Devine ([ptrdvn](https://huggingface.co/ptrdvn)) for Lightblue。