fibonacci0112358/llm-jp-3-13b-finetune-2
Uploaded model
- Developed by: fibonacci0112358
- License: apache-2.0
- Finetuned from model : llm-jp/llm-jp-3-13b
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
サンプルコード'LoRAtemplateunsloth_20241127.ipynb'をベースに以下のプログラムでichikara instruction datasetのすべてのデータを質問のtextが重複するもののうち、一つだけを抽出した合成データを作成する。
import os import json
def mergeuniquejsonfiles(inputfolder, outputfile): seentexts = set() # 重複チェック用セット merged_data = [] # 結合されたデータを格納
# フォルダ内のすべてのJSONファイルを処理 for filename in os.listdir(inputfolder): if filename.endswith('.json'): filepath = os.path.join(inputfolder, filename) with open(filepath, 'r', encoding='utf-8') as f: try: data = json.load(f) for item in data: text = item.get('text') if text and text not in seentexts: seentexts.add(text) mergeddata.append(item) except json.JSONDecodeError: print(f"Error decoding JSON in file: {filepath}")
# 結果を新しいJSONファイルに保存 with open(outputfile, 'w', encoding='utf-8') as f: json.dump(mergeddata, f, ensure_ascii=False, indent=2)
inputfolder = 'ichikaradataset' # JSONファイルが格納されているフォルダのパス outputfile = 'mergedichikaradataset.json' # 出力するJSONファイルのパス mergeuniquejsonfiles(inputfolder, outputfile)
その後、作成した合成データを用いて、サンプルコードに従いfine-tuningを行いモデルを作成した
