CoolFace
Modelpublic

SaniaKhalid/tinyllama-peft-merged

sourceHugging Faceapache-2.0updated 1d agoView on Hugging Face
0likes164downloads
Model Card

๐Ÿฆ™ TinyLlama PEFT Merged

A fully merged, production-ready TinyLlama model fine-tuned with PEFT LoRA

๐Ÿ“Œ Quick Facts

AttributeValue
Model Size2.2 GB
Parameters1.1 Billion
FormatPyTorch Safetensors
PrecisionFP16
Context2048 tokens
Training FrameworkPEFT + TRL
InferenceNo PEFT required

๐Ÿš€ Quick Start

python
from transformers import AutoTokenizer, AutoModelForCausalLM

# One-liner to load
tokenizer = AutoTokenizer.from_pretrained("arif-butt/tinyllama-peft-merged")
model = AutoModelForCausalLM.from_pretrained(
    "arif-butt/tinyllama-peft-merged",
    torch_dtype=torch.float16,
    device_map="auto"
)

# Generate
prompt = "Q: What courses does Arif teach?\nA:"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

๐Ÿ“ฆ What's Inside
tinyllama-peft-merged/
โ”œโ”€โ”€ model.safetensors      # 2.2 GB โ€” merged weights
โ”œโ”€โ”€ config.json            # Model architecture
โ”œโ”€โ”€ generation_config.json # Default generation settings
โ”œโ”€โ”€ tokenizer.json         # Vocabulary (1.76 MB)
โ”œโ”€โ”€ tokenizer_config.json  # Tokenizer settings
โ””โ”€โ”€ special_tokens_map.json # Special tokens

No adapter files. No PEFT needed. Just load and go.


๐Ÿ”ง Generation Settings
outputs = model.generate(
    **inputs,
    max_new_tokens=150,
    temperature=0.7,
    top_p=0.95,
    do_sample=True,
    repetition_penalty=1.1,
    pad_token_id=tokenizer.eos_token_id,
)


๐Ÿ’ฌ Prompt Format
Q: Your question here?
A:
Example:

  Q: What is deep learning?
A: Deep learning is a subset of machine learning...


Q: What is Python?
A: Python is a high-level, interpreted programming language known for its simple, readable syntax. It supports multiple programming paradigms including object-oriented, imperative, and functional programming.

Q: Explain gradient descent
A: Gradient descent is an optimization algorithm used to minimize the loss function in machine learning models. It works by iteratively moving parameters in the direction of the negative gradient.

Q: Name Arif's courses
A: Dr. Muhammad Arif Butt teaches Python Programming, Data Structures & Algorithms, Machine Learning, and Deep Learning courses.

Epoch 1: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘ 0.8
Epoch 2: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 0.4
Epoch 3: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 0.05