license: mit language: en library_name: transformers tags:
text-generation
foundation-model
gpt2
from-scratch
ag_news
Foundation Model: Adbhut Adbhut is a miniature, from-scratch autoregressive language model based on the GPT-2 architecture. This model was pre-trained on a small sample of the ag_news dataset as part of a learning exercise to demonstrate the end-to-end process of creating and sharing a foundation model.
This model is intended for educational purposes only. It showcases the fundamental pipeline of data preparation, tokenizer training, model pre-training, and deployment on the Hugging Face Hub.
Developed by: rohitnagareddy
Model type: Causal language model (decoder-only transformer)
Language: English
License: MIT
How to Use The model can be easily loaded for text generation using the transformers library pipeline.
from transformers import pipeline
Load the model from the Hugging Face Hub
generator = pipeline('text-generation', model='rohitnagareddy/Adbhut')
Generate text
prompt = "The world of technology is" output = generator( prompt, max_length=50, num_return_sequences=1, no_repeat_ngram_size=2 # Add this to prevent simple repetition )
print(output[0]['generated_text'])
Model Architecture Adbhut is a very small GPT-2 style model with the following configuration:
Number of layers: 2
Embedding dimension: 128
Number of attention heads: 2
Vocabulary size: 5,000
Maximum sequence length: 128 positions
Due to its small size, the model has approximately 1.5 million parameters.
Training Details Training Data The model was pre-trained on a small, shuffled sample of the ag_news dataset.
Dataset: ag_news
Sample Size: 2,000 articles
Preprocessing: Each article's text was extracted and used as a separate line in the training corpus.
Training Procedure The model was pre-trained using the Hugging Face Trainer on a single GPU.
Framework: PyTorch
Training Steps: 50
Batch Size: 8
Optimizer: AdamW (default from Trainer)
Objective: Causal Language Modeling (predicting the next token).
Limitations and Intended Use This model is a proof-of-concept and is not suitable for any real-world application.
The primary goal of this project was to learn and demonstrate the training pipeline, not to create a state-of-the-art model. As a result, it has significant limitations:
Repetitive and Incoherent Output: Due to the extremely short training time (50 steps) and tiny dataset, the model has not learned complex grammatical or semantic patterns. Its output is often repetitive and may not make logical sense.
Limited Knowledge: The model's "world knowledge" is confined to the 2,000 news articles it was trained on. It cannot answer questions or discuss topics outside this limited scope.
Bias: The model will reflect the biases present in the ag_news dataset.
No Safety Alignment: This is a raw, pre-trained base model. It has not undergone any instruction tuning or safety alignment (like RLHF). It may produce undesirable or nonsensical text.
The intended use is for others to study the code and the training process, and to use it as a template for training their own small-scale language models.
- Downloads last month
- 1