Downloads · 30 days
5
5% of all-time downloads
iravikr/distilgpt2-movieqa
distilgpt2-movieqa is a question answering model from iravikr. Use it when the input is a question plus a passage. It is set up for transformers. The card lists the license as apache-2.0.
This repository contains a fine-tuned DistilGPT2 model designed to answer movie-related questions. The model can respond to queries about movie plots, directors, cast, and general trivia using a simple prompt format:
Downloads · 30 days
5
5% of all-time downloads
All-time downloads
104
Public
Parameters
81.9M
328 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors328 MB · 99%
From the Hugging Face model README
This repository contains a fine-tuned DistilGPT2 model designed to answer movie-related questions.
The model can respond to queries about movie plots, directors, cast, and general trivia using a simple prompt format:
The goal of this project is to demonstrate domain-specific fine-tuning of a lightweight language model using publicly available movie datasets.
The model was fine-tuned using the following datasets from Hugging Face:
HiTruong/movie_QA
Pablinho/movies-dataset
All training samples were normalized into the following text format:
from transformers import pipeline
pipe = pipeline(
"text-generation",
model="iravikr/distilgpt2-movieqa",
tokenizer="iravikr/distilgpt2-movieqa"
)
pipe(
"Question: Who directed Inception?\nAnswer:",
max_new_tokens=40,
temperature=0.7,
top_p=0.9
)
Question: Who directed Inception?
Answer: Inception was directed by Christopher Nolan.
---
## Training Procedure
### Preprocessing
- Converted structured movie metadata into natural language QA pairs.
- Tokenized using the DistilGPT2 tokenizer.
- Maximum sequence length: 256 tokens.
- Padding token set to EOS token.
### Hyperparameters
- **Training regime:** fp16 mixed precision
- **Optimizer:** AdamW
- **Learning rate:** 5e-5
- **Epochs:** 3
- **Effective batch size:** 16 (via gradient accumulation)
- **Total training steps:** 13,095
---
## Hardware and Compute
- **GPU:** NVIDIA T4 (16 GB VRAM)
- **CPU:** Intel Xeon (Google Colab backend)
- **RAM:** ~12 GB
- **Platform:** Google Colab
- **Training time:** Approximately 1.1 hours
---
## Training Outcome
- **Initial training loss:** ~2.98
- **Final training loss:** ~2.29
The steady loss reduction indicates stable convergence without overfitting.
---
## Intended Use
### Direct Use
- Movie question answering systems
- Movie trivia bots
- Educational and demonstration projects
- Lightweight domain-specific assistants
### Downstream Use
- Integration with retrieval systems (FAISS / Chroma) for RAG-based QA
- Deployment via FastAPI or Streamlit
- Extension for recommendation-style prompts
### Out-of-Scope Use
- Real-time or up-to-date movie facts without retrieval
- Complex multi-hop reasoning
- High-stakes decision-making systems
- Long-context conversational memory
---
## Limitations and Risks
- The model may hallucinate facts for movies not seen during training.
- Knowledge is limited to the scope of the training datasets.
- Dataset bias toward popular and English-language films may exist.
### Recommendations
- Use retrieval augmentation for production deployments.
- Validate responses for factual accuracy.
- Avoid use as a sole authoritative source.
---
## How to Use
### Loading the Model
```python
from transformers import pipeline
pipe = pipeline(
"text-generation",
model="iravikr/distilgpt2-movieqa",
tokenizer="iravikr/distilgpt2-movieqa"
)
pipe(
"Question: Who directed Inception?\nAnswer:",
max_new_tokens=40,
temperature=0.7,
top_p=0.9
)