🧠 phi2-lora-instruct

This is a LoRA fine-tuned version of Microsoft’s Phi-2 model trained on 500 examples from the yahma/alpaca-cleaned instruction dataset.

βœ… Fine-Tuned by:

howtomakepplragequit β€” working on scalable, efficient LLM training for real-world instruction-following.


πŸ—οΈ Model Architecture

  • Base model: microsoft/phi-2 (2.7B parameters)
  • Adapter: LoRA (Low-Rank Adaptation), trained with PEFT
  • Quantization: 4-bit NF4 via bitsandbytes for efficient memory use

πŸ“¦ Dataset

  • yahma/alpaca-cleaned
  • Instruction-based Q&A for natural language understanding and generation
  • Covers topics like science, grammar, everyday tasks, and reasoning

πŸ› οΈ Training Details

  • Training platform: Google Colab (Free T4 GPU)
  • Epochs: 2
  • Batch size: 2 (with gradient accumulation)
  • Optimizer: AdamW (via Transformers Trainer)
  • Training time: ~20–30 mins

πŸ“ˆ Intended Use

  • Ideal for instruction-following tasks, such as:
    • Explanation
    • Summarization
    • List generation
    • Creative writing
  • Can be adapted to custom domains (health, code, manufacturing) by adding your own prompts + responses.

πŸš€ Example Prompt

Instruction: Give three tips to improve time management.


πŸ§ͺ Try it Out

To use this model in your own project:

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("howtomakepplragequit/phi2-lora-instruct")
tokenizer = AutoTokenizer.from_pretrained("howtomakepplragequit/phi2-lora-instruct")

input_text = "### Instruction:\nExplain how machine learning works.\n\n### Response:"
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
output = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(output[0], skip_special_tokens=True))
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for howtomakepplragequit/phi2-lora-instruct

Base model

microsoft/phi-2
Adapter
(875)
this model

Dataset used to train howtomakepplragequit/phi2-lora-instruct

Space using howtomakepplragequit/phi2-lora-instruct 1