Views
No views yet
1LoraConfig(
2 r=8,
3 lora_alpha=8,
4 lora_dropout=0.05,
5 bias="none",
6 task_type="CAUSAL_LM",
7 target_modules=['k_proj', 'v_proj', 'q_proj', 'dense']
8)1BitsAndBytesConfig(
2 load_in_4bit=True,
3 llm_int8_threshold=6.0,
4 llm_int8_has_fp16_weight=False,
5 bnb_4bit_compute_dtype=torch.bfloat16,
6 bnb_4bit_use_double_quant=True,
7 bnb_4bit_quant_type="nf4",
8)device_map = {"": 0}1DPOConfig(
2 per_device_train_batch_size=2,
3 gradient_accumulation_steps=4,
4 gradient_checkpointing=True,
5 learning_rate=5e-5,
6 lr_scheduler_type="cosine",
7 max_steps=50,
8 save_strategy="no",
9 logging_steps=1,
10 output_dir=new_model,
11 optim="paged_adamw_32bit",
12 warmup_steps=5,
13)1DPOTrainer(
2 model,
3 args=training_args,
4 train_dataset=updated_train_dataset,
5 tokenizer=tokenizer,
6 peft_config=peft_config,
7 beta=0.1,
8 max_prompt_length=512,
9 max_length=1024,
10)1@misc{dhruvparth_mistral7b_dpo_2024,
2 author = {Dhruv Parthasarathy},
3 title = {Fine-tuning LLMs with Direct Preference Optimization},
4 year = {2024},
5 publisher = {GitHub},
6 journal = {GitHub repository},
7 url = {https://huggingface.co/DhruvParth/Mistral-7B-Instruct-v2.0-PairRM-DPO}
8}