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: paged_adamw_32bit
Training Hyperparameters The following hyperparameters were used during training:
learning_rate: 2e-05
train_batch_size: 1
eval_batch_size: 1
seed: 42
gradient_accumulation_steps: 2
total_train_batch_size: 2
optimizer: Use OptimizerNames.PAGED_ADAMW_8BIT with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
lr_scheduler_type: cosine
lr_scheduler_warmup_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
model_id = "Priyanka1218/my-stablelm-zephyr-finetune" tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=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} ] input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt").to("cuda")
outputs = model.generate(input_ids, max_new_tokens=256) print(tokenizer.decode(outputs[0], skip_special_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
- Downloads last month
- 2
Model tree for Priyanka1218/my-stablelm-zephyr-finetune
Base model
stabilityai/stablelm-zephyr-3b