Views
No views yet
LoftQ/Phi-3-mini-4k-instruct-4bit-64rank, is obtained from Phi-3-mini-4k-instruct.
The backbone is under LoftQ/Phi-3-mini-4k-instruct-4bit-64rank and LoRA adapters are under the subfolder='loftq_init'.1import torch
2from transformers import AutoModelForCausalLM, BitsAndBytesConfig
3from peft import PeftModel
4
5MODEL_ID = "LoftQ/Phi-3-mini-4k-instruct-4bit-64rank"
6
7base_model = AutoModelForCausalLM.from_pretrained(MODEL_ID, trust_remote_code=True)
8peft_model = PeftModel.from_pretrained(
9 base_model,
10 MODEL_ID,
11 subfolder="loftq_init",
12 is_trainable=True,
13)
14
15# Do training with peft_model ...1@article{li2023loftq,
2 title={Loftq: Lora-fine-tuning-aware quantization for large language models},
3 author={Li, Yixiao and Yu, Yifan and Liang, Chen and He, Pengcheng and Karampatziakis, Nikos and Chen, Weizhu and Zhao, Tuo},
4 journal={arXiv preprint arXiv:2310.08659},
5 year={2023}
6}