Downloads · 30 days
0
logits/llama2-7b-book-qa
llama2-7b-book-qa is a machine learning model from logits. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Nov 10, 2023
Repo size
33.6 MB
Likes
0
Public
Click a slice to open those files.
.bin33.6 MB · 100%
From the Hugging Face model README
from transformers import LlamaForCausalLM, LlamaTokenizer
from peft import PeftModelForCausalLM
base_model = LlamaForCausalLM.from_pretrained("your/llama/path")
tokenizer = LlamaTokenizer.from_pretrained("your/llama/path")
llama_lora = PeftModelForCausalLM.from_pretrained(base_model, "logits/llama2-7b-book-qa")
prompt = "your prompt"
input_ids = tokenizer(prompt).input_ids.cuda()
output_ids = llama_lora(input_ids=input_ids)
output = tokenizer.decode(output_ids)
print(output)