Views
No views yet
historical-gpt2-finetunedgpt2 trained on 500 conversational question-answer pairs focused on the Two-Nation Theory, the Pakistan Movement, and key historical figures like Jinnah and Iqbal. This model generates historically-aligned answers in a chatbot-style format, simulating a Q&A assistant.| Property | Value |
|---|---|
| Base Model | GPT-2 (gpt2) |
| Fine-tuned By | Muhammad Yasir (DevSecure) |
| Language | English (conversational, formal tone) |
| Dataset Size | 500 examples (JSONL format) |
| Use Case | Conversational history tutor, education, research |
| Training Loss | 0.1233 (after 3 epochs) |
| Trained on | Custom .jsonl file with Two-Nation Theory Q&A |
| License | MIT |
{"text": "Yasir: What was the Two-Nation Theory?\nAI: The Two-Nation Theory stated that Muslims and Hindus were two distinct nations with their own customs, religion, and traditions, and therefore Muslims should have a separate homeland.\n"}1from transformers import pipeline
2
3generator = pipeline("text-generation", model="jamyasir/historical-gpt2-finetuned")
4
5prompt = "Yasir: What was Gandhi's opinion on the Two-Nation Theory?\nAI:"
6response = generator(prompt, max_length=100, do_sample=True, temperature=0.7)[0]['generated_text']
7print(response)| Config | Value |
|---|---|
| Epochs | 3 |
| Optimizer | AdamW (default) |
| Max Length | 128 tokens |
| Tokenizer | GPT-2 (pad_token = eos_token) |
| Learning Rate | 5e-5 |
| Framework | Hugging Face Trainer |
Yasir: Who introduced the Two-Nation Theory?\nAI:
Response:The concept was popularized by Allama Iqbal in 1930 and later advocated by Muhammad Ali Jinnah.
Yasir: Why did Jinnah believe Muslims needed a separate homeland?\nAI:
Response:Jinnah believed that due to religious and cultural differences, Muslims needed an independent state to preserve their identity and rights.
1@misc{yasir2025twonationgpt2,
2 author = {Muhammad Yasir},
3 title = {GPT-2 Fine-Tuned on Two-Nation Theory Debates},
4 howpublished = {\url{https://huggingface.co/jamyasir/historical-gpt2-finetuned}},
5 year = {2025}
6}