Update README.md
Browse files
README.md
CHANGED
@@ -33,7 +33,7 @@ This llama model was trained 2x faster with [Unsloth](https://github.com/unsloth
|
|
33 |
|
34 |
## **特徴**
|
35 |
- **モデル名:** `llm-jp-3-13b-itnew9`
|
36 |
-
- **ベースモデル:** `llm-jp/llm-jp-3-13b
|
37 |
- **微調整目的:** 日本語の指示応答能力を強化。
|
38 |
- **量子化:** 4bit (qLoRA)
|
39 |
- **LoRA設定:**
|
@@ -118,11 +118,9 @@ print(response)
|
|
118 |
## **注意点と制約**
|
119 |
- 本モデルは日本語の指示応答タスクに特化しており、他のタスクや言語での性能は保証されません。
|
120 |
- ライセンス条件により、商用利用は許可されていません。
|
121 |
-
```
|
122 |
-
|
123 |
|
124 |
-
#実行コード
|
125 |
|
|
|
126 |
|
127 |
# Google Colabの場合はunslothのインストールのみを行ってください
|
128 |
!pip uninstall unsloth -y && pip install --upgrade --no-cache-dir "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
|
@@ -148,11 +146,10 @@ load_in_4bit = True # 今回は8Bクラスのモデルを扱うためTrue
|
|
148 |
|
149 |
model_id = "daichira/llm-jp-3-13b-finetune2"
|
150 |
|
151 |
-
|
152 |
-
#llm-jp-3-13b-finetune2:ベースモデルをichikara-instruction-003-001-1.jsonでsft
|
153 |
-
|
154 |
|
155 |
new_model_id = "llm-jp-3-13b-itnew9" #Fine-Tuningしたモデルにつけたい名前
|
|
|
156 |
# FastLanguageModel インスタンスを作成
|
157 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
158 |
model_name=model_id,
|
@@ -235,7 +232,6 @@ formatting_prompts_func: 各データをプロンプトに合わせた形式に
|
|
235 |
"""
|
236 |
EOS_TOKEN = tokenizer.eos_token # トークナイザーのEOSトークン(文末トークン)
|
237 |
def formatting_prompts_func(examples):
|
238 |
-
# input = examples["text"] # 入力データ
|
239 |
input = examples["instruction"] # 入力データ
|
240 |
output = examples["output"] # 出力データ
|
241 |
text = prompt.format(input, output) + EOS_TOKEN # プロンプトの作成
|
@@ -285,7 +281,6 @@ trainer_stats = trainer.train()
|
|
285 |
|
286 |
# ELYZA-tasks-100-TVの読み込み。事前にファイルをアップロードしてください
|
287 |
# データセットの読み込み。
|
288 |
-
# omnicampusの開発環境では、左にタスクのjsonlをドラッグアンドドロップしてから実行。
|
289 |
import json
|
290 |
datasets = []
|
291 |
#with open("./elyza-tasks-100-TV_0.jsonl", "r") as f:
|
@@ -322,3 +317,4 @@ with open(f"{new_model_id}_output.jsonl", 'w', encoding='utf-8') as f:
|
|
322 |
for result in results:
|
323 |
json.dump(result, f, ensure_ascii=False)
|
324 |
f.write('\n')
|
|
|
|
33 |
|
34 |
## **特徴**
|
35 |
- **モデル名:** `llm-jp-3-13b-itnew9`
|
36 |
+
- **ベースモデル:** `llm-jp/llm-jp-3-13b`
|
37 |
- **微調整目的:** 日本語の指示応答能力を強化。
|
38 |
- **量子化:** 4bit (qLoRA)
|
39 |
- **LoRA設定:**
|
|
|
118 |
## **注意点と制約**
|
119 |
- 本モデルは日本語の指示応答タスクに特化しており、他のタスクや言語での性能は保証されません。
|
120 |
- ライセンス条件により、商用利用は許可されていません。
|
|
|
|
|
121 |
|
|
|
122 |
|
123 |
+
## **実行コード**
|
124 |
|
125 |
# Google Colabの場合はunslothのインストールのみを行ってください
|
126 |
!pip uninstall unsloth -y && pip install --upgrade --no-cache-dir "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
|
|
|
146 |
|
147 |
model_id = "daichira/llm-jp-3-13b-finetune2"
|
148 |
|
149 |
+
#llm-jp-3-13b-finetune2:llm-jp/llm-jp-3-13bをichikara-instruction-003-001-1.jsonでsft
|
|
|
|
|
150 |
|
151 |
new_model_id = "llm-jp-3-13b-itnew9" #Fine-Tuningしたモデルにつけたい名前
|
152 |
+
|
153 |
# FastLanguageModel インスタンスを作成
|
154 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
155 |
model_name=model_id,
|
|
|
232 |
"""
|
233 |
EOS_TOKEN = tokenizer.eos_token # トークナイザーのEOSトークン(文末トークン)
|
234 |
def formatting_prompts_func(examples):
|
|
|
235 |
input = examples["instruction"] # 入力データ
|
236 |
output = examples["output"] # 出力データ
|
237 |
text = prompt.format(input, output) + EOS_TOKEN # プロンプトの作成
|
|
|
281 |
|
282 |
# ELYZA-tasks-100-TVの読み込み。事前にファイルをアップロードしてください
|
283 |
# データセットの読み込み。
|
|
|
284 |
import json
|
285 |
datasets = []
|
286 |
#with open("./elyza-tasks-100-TV_0.jsonl", "r") as f:
|
|
|
317 |
for result in results:
|
318 |
json.dump(result, f, ensure_ascii=False)
|
319 |
f.write('\n')
|
320 |
+
```
|