Downloads · 30 days
5
15% of all-time downloads
Abinaya/opt-1.3b-lora-summary
opt-1.3b-lora-summary is a machine learning model from Abinaya. 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
5
15% of all-time downloads
All-time downloads
33
Public
Repo size
12.6 MB
Likes
0
Public
Click a slice to open those files.
.bin12.6 MB · 100%
From the Hugging Face model README
The following bitsandbytes quantization config was used during training:
import torch
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer
peft_model_id = "Abinaya/opt-1.3-b-lora"
config = PeftConfig.from_pretrained("Abinaya/opt-1.3b-lora-summary")
model = AutoModelForCausalLM.from_pretrained("facebook/opt-1.3b")
model = PeftModel.from_pretrained(model, "Abinaya/opt-1.3b-lora-summary")
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
# Load the Lora model
model = PeftModel.from_pretrained(model, peft_model_id)
batch = tokenizer("Natural language processing is an interdisciplinary subfield of linguistics, computer science, and artificial intelligence concerned with the interactions between computers and human language, in particular how to program computers to process and analyze large amounts of natural language data", return_tensors='pt')
with torch.cuda.amp.autocast():
output_tokens = model.generate(**batch, max_new_tokens=50)
print('\n\n', tokenizer.decode(output_tokens[0], skip_special_tokens=True))