Views
No views yet
1from transformers import LlamaForCausalLM
2from peft import PeftModel
3
4model = LlamaForCausalLM.from_pretrained(
5 "decapoda-research/llama-7b-hf",
6 load_in_8bit=True,
7 torch_dtype=torch.float16,
8 device_map="auto",
9)
10model = PeftModel.from_pretrained(
11 model,
12 "Chinese-Vicuna/Chinese-Vicuna-lora-7b-chatv1"
13 torch_dtype=torch.float16,
14 device_map={'': 0}
15)