Views
No views yet
q_proj (Query projection)k_proj (Key projection)v_proj (Value projection)o_proj (Output projection)up_proj (Upsampling projection)down_proj (Downsampling projection)gate_proj (Gate projection)1from peft import PeftModel, PeftConfig
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4# Load base model
5base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-instruct")
6tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.1-8B-instruct")
7
8# Load LoRA adapter
9model = PeftModel.from_pretrained(base_model, "path_to_adapter")