Downloads · 30 days
0
DataAgent/llama-7b-alpaca-zh-20k
llama-7b-alpaca-zh-20k is a machine learning model from DataAgent. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Downloads · 30 days
0
Access
Public
Updated Apr 8, 2023
Repo size
16.8 MB
Likes
0
Public
Click a slice to open those files.
.bin16.8 MB · 100%
From the Hugging Face model README
from peft import PeftModel
from transformers import GenerationConfig, LlamaForCausalLM, LlamaTokenizer
tokenizer = LlamaTokenizer.from_pretrained("decapoda-research/llama-7b-hf")
model = LlamaForCausalLM.from_pretrained(
"decapoda-research/llama-7b-hf",
load_in_8bit=True,
torch_dtype=torch.float16,
device_map="auto"
)
model = PeftModel.from_pretrained(
model,
"DataAgent/llama-7b-alpaca-zh-20k",
torch_dtype=torch.float16
)