Downloads · 30 days
0
genkida/genkidakun_202407
genkidakun_202407 is a machine learning model from genkida. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
import torch from peft import PeftModel, PeftConfig from transformers import AutoModelForCausalLM, AutoTokenizer
Downloads · 30 days
0
Access
Public
Updated Jul 14, 2024
Repo size
20.3 MB
Likes
0
Public
Click a slice to open those files.
.safetensors19.5 MB · 86%
From the Hugging Face model README
import torch from peft import PeftModel, PeftConfig from transformers import AutoModelForCausalLM, AutoTokenizer
peft_model_id = "genkida/genkidakun_202407" config = PeftConfig.from_pretrained(peft_model_id)
base_model = AutoModelForCausalLM.from_pretrained( config.base_model_name_or_path, load_in_4bit=True, device_map="auto") tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
model = PeftModel.from_pretrained( base_model, peft_model_id, state_dict=base_model.state_dict(), device_map="auto", torch_dtype=torch.float16) model.eval()