Downloads · 30 days
4
24% of all-time downloads
sayril007/opt_lora-7b-lora-pretrained
opt_lora-7b-lora-pretrained is a machine learning model from sayril007. 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: - quantmethod: bitsandbytes - loadin8bit: True - loadin4bit: False - llmint8threshold: 6.0 - llmint8skipmodules: None - llmint8enablefp32cpuoffl…
Downloads · 30 days
4
24% of all-time downloads
All-time downloads
17
Public
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
The following bitsandbytes quantization config was used during training:
import torch from peft import PeftModel, PeftConfig from transformers import AutoModelForCausalLM, AutoTokenizer
peft_model_id = "sayril007/opt_lora-7b-lora-pretrained" 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)
model = PeftModel.from_pretrained(model, peft_model_id)
batch = tokenizer("Two things are infinite: ", 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))