Spaces:
Paused
Paused
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 | |
) | |