Skip to content

gpt2-small_classifier

Choose a tag to compare

@Avaneesh40585 Avaneesh40585 released this 12 Jan 21:08
· 6 commits to main since this release

Fine-Tuned GPT-2 Sentiment Classifier (IMDB)

This release contains the fine-tuned model weights (gpt2-small_classifier.pth) for the Binary Sentiment Analysis task. These weights allow users to run inference or evaluation immediately without needing to retrain the model from scratch.


Performance Metrics

The model was fine-tuned on the IMDB Large Movie Review Dataset (25,000 training examples) and evaluated on the official test set (25,000 examples).

Metric Value
Test Accuracy 91.83%
Test Loss 0.2026
Base Model GPT-2 Small (124M)

Usage Instructions

  1. Download gpt2-small_classifier.pth from the Assets section below.
  2. Place the file in the classification-finetuning/model_weights/ directory.
  3. Run the main.ipynb notebook. Set MODE = "inference" or run the evaluation cells. The pipeline will detect the weights:
    # Expected output:
    --- PREPARING FOR INFERENCE ---
    Loading trained classifier from: ./model_weights/gpt2-small_classifier.pth
    Moving model to mps...
    

Critical Requirement:
These weights are strictly coupled to the GPT-2 Small (124M) architecture with a custom 2-class Classification Head.

  • Do not try to load these into gpt2-medium or other sizes.
  • Do not try to load these into a standard Hugging Face model class directly; they require the custom GPTClassifier wrapper defined in main.ipynb.

Generated by the classification-finetuning/main.ipynb pipeline on Apple Silicon (M3 Pro)