Downloads · 30 days
7
22% of all-time downloads
marianna13/alpaca-lora-sum
alpaca-lora-sum is a machine learning model from marianna13. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
The following bitsandbytes quantization config was used during training: - loadin8bit: True - loadin4bit: False - llmint8threshold: 6.0 - llmint8skipmodules: None - llmint8enablefp32cpuoffload: False - llmint8hasfp16w…
Downloads · 30 days
7
22% of all-time downloads
All-time downloads
32
Public
Repo size
443 B
Likes
0
Public
Click a slice to open those files.
.md1.7 KB · 42%
From the Hugging Face model README
The following bitsandbytes quantization config was used during training:
from peft import PeftModel
temperature: float = 0.1,
top_p: float = 0.75
top_k: int = 40,
num_beams: int = 4,
max_new_tokens: int = 128
load_8bit: bool = False
lora_weights: str = "marianna13/alpaca-lora-sum"
model = LlamaForCausalLM.from_pretrained(
base_model,
load_in_8bit=load_8bit,
torch_dtype=torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(
model,
lora_weights,
torch_dtype=torch.float16,
)
inputs = tokenizer(prompt, return_tensors="pt")
input_ids = inputs["input_ids"].to(device)
generation_config = GenerationConfig(
temperature=temperature,
top_p=top_p,
top_k=top_k,
num_beams=num_beams,
**kwargs,
)
with torch.no_grad():
generation_output = model.generate(
input_ids=input_ids,
generation_config=generation_config,
return_dict_in_generate=True,
output_scores=True,
max_new_tokens=max_new_tokens,
)