Downloads · 30 days
3
2% of all-time downloads
0xk1h0/codegen2.5-7b-py150k-r20-QLoRA
codegen2.5-7b-py150k-r20-QLoRA is a machine learning model from 0xk1h0. 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: False - loadin4bit: True - llmint8threshold: 6.0 - llmint8skipmodules: None - llmint8enablefp32cpuoffload: False - llmint8hasfp16w…
Downloads · 30 days
3
2% of all-time downloads
All-time downloads
145
Public
Repo size
403 MB
Likes
1
Public
Click a slice to open those files.
.pt269 MB · 67%
From the Hugging Face model README
import wandb
import os
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, TrainingArguments
from peft import LoraConfig, prepare_model_for_kbit_training, get_peft_model, AutoPeftModelForCausalLM
from datasets import load_dataset
from random import randrange
from trl import SFTTrainer
from huggingface_hub import login
tokenizer = AutoTokenizer.from_pretrained("Salesforce/codegen25-7b-mono", trust_remote_code=True)
tokenizer.pad_token = tokenizer.eos_token
device_map = {"":0}
model = AutoPeftModelForCausalLM.from_pretrained("0xk1h0/codegen2.5-7b-py150k-r20-QLoRA", device_map=device_map, torch_dtype=torch.bfloat16)
text ="""
# Generate AES MODE encrypt python function.
"""
inputs = tokenizer(text, return_tensors="pt").to("cuda")
outputs = model.generate(
input_ids=inputs["input_ids"].to("cuda"),
attention_mask=inputs["attention_mask"],
# max_new_tokens=50,
max_length=256,
do_sample=True,
temperature = 0.4,
top_p=0.95,
pad_token_id=tokenizer.eos_token_id
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
The following bitsandbytes quantization config was used during training:
The following bitsandbytes quantization config was used during training:
PEFT 0.5.0
PEFT 0.5.0