Views
No views yet
Qwen/Qwen2.5-7B-Instruct に対し、SFTおよび3段階のDPO(Direct Preference Optimization)を適用して調整されています。
特に最終段階(Round 3)では、JSON形式の厳格な出力(コードブロックや説明文の排除)に特化して学習を行いました。daichira/structured-hard-sft-4k (High Quality) + u-10bei/structured_data_with_cot_dataset_512_v4u-10bei/dpo-dataset-qwen-cot (JSONタスク抽出)json ... )...){ で始まり } で終わる純粋なJSON以外は学習データから除外。1from unsloth import FastLanguageModel
2
3model, tokenizer = FastLanguageModel.from_pretrained(
4 model_name = "YOUR_USERNAME/dpo-qwen-round3-final", # Replace with your repo id
5 max_seq_length = 2048,
6 dtype = None,
7 load_in_4bit = True,
8)
9FastLanguageModel.for_inference(model)
10
11prompt = "以下のデータをJSON形式に変換してください..."
12inputs = tokenizer([prompt], return_tensors = "pt").to("cuda")
13
14outputs = model.generate(**inputs, max_new_tokens = 512, use_cache = True)
15print(tokenizer.batch_decode(outputs))