Priyanka1218/my-stablelm-zephyr-finetune
license: apache-2.0 base_model: stabilityai/stablelm-zephyr-3b tags:
text-generation
fine-tune
qlora
instruct
stablelm
pytorch
My StableLM Zephyr Fine-tune This is a fine-tuned version of the stabilityai/stablelm-zephyr-3b model, trained using the QLoRA method with the Axolotl framework.
Model Description This model was fine-tuned for instruction-following on a small, custom dataset. The training objective was to demonstrate the fine-tuning process and to produce a model that can follow basic instructions and generate text in a clear, concise manner.
Training Details The model was trained for 50 steps using the following key parameters:
Base Model: stabilityai/stablelm-zephyr-3b
Adapter Method: QLoRA
Training Dataset: A small, custom, in-line dataset.
LoRA Rank (lora_r): 32
LoRA Alpha (lora_alpha): 16
Sequence Length: 2048
Optimizer: pagedadamw32bit
Training Hyperparameters The following hyperparameters were used during training:
learning_rate: 2e-05
trainbatchsize: 1
evalbatchsize: 1
seed: 42
gradientaccumulationsteps: 2
totaltrainbatch_size: 2
optimizer: Use OptimizerNames.PAGEDADAMW8BIT with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
lrschedulertype: cosine
lrschedulerwarmup_steps: 2
training_steps: 25
Evaluation Results The training job completed with the following metrics:
Training Loss: 1.4527
Training Runtime: 940.66 seconds
Training Samples per Second: 0.409
How to Use You can use this model with the transformers library for text generation. Make sure you have the necessary libraries installed and a GPU available.
import torch from transformers import AutoTokenizer, AutoModelForCausalLM
modelid = "Priyanka1218/my-stablelm-zephyr-finetune" tokenizer = AutoTokenizer.frompretrained(modelid) model = AutoModelForCausalLM.frompretrained(modelid, torchdtype=torch.float16, device_map="auto")
prompt = "Explain the difference between a list and a tuple in Python." messages = [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": prompt} ] inputids = tokenizer.applychattemplate(messages, returntensors="pt").to("cuda")
outputs = model.generate(inputids, maxnewtokens=256) print(tokenizer.decode(outputs[0], skipspecial_tokens=True))
Dataset The model was fine-tuned on a very small custom dataset in the Alpaca format. For better performance, a larger and more diverse dataset would be required
