Downloads Β· 30 days
58
22% of all-time downloads
Vijay1303/delta
delta is a machine learning model from Vijay1303. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Delta is a tiny transformer-based language model inspired by GPT-2, designed to be lightweight, fast, and helpful for simple natural language tasks.
Downloads Β· 30 days
58
22% of all-time downloads
All-time downloads
262
Public
Parameters
6.8M
180 MB on disk
Likes
1
Public
Click a slice to open those files.
.pt110 MB Β· 49%
From the Hugging Face model README
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.
PyTorch, ready for GGUF/Ollama conversionconfig.json: GPT2 model configurationpytorch_model.bin: Fine-tuned model weightstokenizer_config.json, vocab.json, merges.txt: Tokenizer filesgeneration_config.json: Optional generation tuningREADME.md: Youβre reading it!main.py: (Optional) FastAPI local serving codeInstall 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))
pip install fastapi uvicorn transformers torch
uvicorn main:app --reload --port 8000
curl -X POST http://localhost:8000/generate \
-H "Content-Type: application/json" \
-d '{"prompt": "Hello Delta,", "max_length": 50}'
You can:
Vijay1303
Hugging Face Profile
Feel free to β the repo if you find this useful!