YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

πŸ€– Delta - Tiny Helpful Assistant (GPT2-style)

Delta is a tiny transformer-based language model inspired by GPT-2, designed to be lightweight, fast, and helpful for simple natural language tasks.

This project demonstrates how to train a minimal GPT-2-like model using Hugging Face Transformers on custom text, then serve it locally via a FastAPI API or deploy it to Hugging Face Hub.


🧠 Model Details

  • Architecture: GPT2 (custom config)
  • Parameters: ~4.7M
  • Layers: 2
  • Embedding Size: 128
  • Heads: 2
  • Max Sequence Length: 128
  • Trained on: ~300 characters (demo text)
  • Format: PyTorch, ready for GGUF/Ollama conversion

πŸ“ Files Included

  • config.json: GPT2 model configuration
  • pytorch_model.bin: Fine-tuned model weights
  • tokenizer_config.json, vocab.json, merges.txt: Tokenizer files
  • generation_config.json: Optional generation tuning
  • README.md: You’re reading it!
  • main.py: (Optional) FastAPI local serving code

πŸš€ Quick Start (Hugging Face Transformers)

Install dependencies:

pip install transformers torch

Load and use the model:

from transformers import GPT2Tokenizer, GPT2LMHeadModel

tokenizer = GPT2Tokenizer.from_pretrained("Vijay1303/delta")
model = GPT2LMHeadModel.from_pretrained("Vijay1303/delta")
model.eval()

input_ids = tokenizer("Hello Delta, can you help me?", return_tensors="pt").input_ids
outputs = model.generate(input_ids, max_length=50, do_sample=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

🌐 Run Locally via FastAPI

  1. Install dependencies:
pip install fastapi uvicorn transformers torch
  1. Run server:
uvicorn main:app --reload --port 8000
  1. Query API:
curl -X POST http://localhost:8000/generate \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Hello Delta,", "max_length": 50}'

πŸ“¦ Deployment

You can:

  • Convert to GGUF for Ollama or llama.cpp
  • Push to Hugging Face Hub
  • Serve via an API (FastAPI, Flask, etc.)

⚠️ Limitations

  • Trained on a small dataset (~300 characters)
  • Not suitable for production tasks
  • For experimentation and educational use

πŸ“š References


πŸ‘¨β€πŸ’» Author

Vijay1303
Hugging Face Profile
Feel free to ⭐ the repo if you find this useful!

Downloads last month
12
Safetensors
Model size
6.85M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support