stormy-7b-10ep / model_pull.py
masanorihirano's picture
update
b491e93
raw history blame
No virus
513 Bytes
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM
from transformers import AutoTokenizer
BASE_MODEL = "cyberagent/open-calm-7b"
LORA_WEIGHTS = "izumi-lab/stormy-7b-10ep"
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
load_in_8bit=False,
torch_dtype=torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(
model, LORA_WEIGHTS, torch_dtype=torch.float16, use_auth_token=True
)