Downloads · 30 days
9
27% of all-time downloads
Andyrasika/bloom-560m-lora-tagger
bloom-560m-lora-tagger is a machine learning model from Andyrasika. 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
9
27% of all-time downloads
All-time downloads
33
Public
Repo size
6.3 MB
Likes
1
Public
Click a slice to open those files.
.bin6.3 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 = "Andyrasika/bloom-560m-lora-tagger"
config = PeftConfig.from_pretrained(peft_model_id)
model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True, device_map='auto')
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
# Load the Lora model
model = PeftModel.from_pretrained(model, peft_model_id)
batch = tokenizer("“Training models with PEFT and LoRa is cool” ->: ", 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))