Run this model with HF Jobs
Run rIsHu009/distilbert-imdb-mlm-accelerate on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/rIsHu009/distilbert-imdb-mlm-accelerate. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/rIsHu009/distilbert-imdb-mlm-accelerate on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use rIsHu009/distilbert-imdb-mlm-accelerate with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rIsHu009/distilbert-imdb-mlm-accelerate with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="rIsHu009/distilbert-imdb-mlm-accelerate")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("rIsHu009/distilbert-imdb-mlm-accelerate") model = AutoModelForMaskedLM.from_pretrained("rIsHu009/distilbert-imdb-mlm-accelerate", device_map="auto") - Notebooks
- Google Colab
- Kaggle
DistilBERT IMDb β Masked Language Modeling (Accelerate)
A DistilBERT masked-language model adapted on IMDb movie-review text as part of my hands-on study of lower-level Transformer training with Hugging Face Accelerate.
This checkpoint is the Accelerate-based companion to:
β‘οΈ rIsHu009/distilbert-imdb-mlm-trainer
This is a masked-language-modeling experiment, not an IMDb sentiment classifier.
Experiment
The experiment continues masked-language-model training on movie-review-domain text while using an Accelerate-oriented training workflow.
IMDb review text
β
DistilBERT tokenizer
β
random token masking
β
DistilBERT encoder
β
Accelerate training workflow
β
masked-token prediction
Rather than predicting positive or negative sentiment, the model learns to reconstruct masked tokens from their surrounding context.
Model Details
| Property | Value |
|---|---|
| Architecture | DistilBertForMaskedLM |
| Task | Masked Language Modeling |
| Pipeline | Fill-Mask |
| Base model | distilbert-base-uncased |
| Text domain | Movie reviews / IMDb |
| Transformer layers | 6 |
| Hidden size | 768 |
| Attention heads | 12 |
| FFN dimension | 3,072 |
| Vocabulary size | 30,522 |
| Maximum sequence length | 512 |
| Weight precision | FP32 |
The checkpoint preserves the standard DistilBERT masked-language-model architecture rather than a sequence-classification head.
Masked Language Modeling
Masked language modeling hides selected tokens from an input sequence and trains the model to recover them.
For example:
Input:
The acting in this movie was [MASK].
Possible prediction:
excellent
The model produces a probability distribution over its 30,522-token vocabulary for the masked position.
This training objective can adapt language representations to the style and vocabulary of a particular text domain without requiring classification labels.
Accelerate Training
This repository represents the Accelerate-oriented implementation of the IMDb MLM experiment.
The repository history preserves training progress through epoch 2.
Compared with the higher-level Hugging Face Trainer, an Accelerate-oriented workflow exposes more of the underlying training process while still assisting with:
- device placement;
- mixed precision;
- gradient synchronization;
- distributed execution;
- model and optimizer preparation;
- dataloader preparation.
This makes the checkpoint useful as part of a Trainer-vs-Accelerate learning comparison.
Evaluation
No verified final evaluation metric was preserved with this Accelerate repository.
Therefore, this card intentionally does not copy the validation losses from the companion Trainer checkpoint.
Those results belong to the separately preserved Trainer experiment.
No sentiment-classification accuracy is reported because this checkpoint does not contain a sentiment-classification head.
Quick Start
from transformers import pipeline
MODEL_ID = "rIsHu009/distilbert-imdb-mlm-accelerate"
fill_mask = pipeline(
"fill-mask",
model=MODEL_ID,
)
predictions = fill_mask(
"The movie was absolutely [MASK] and worth watching."
)
for prediction in predictions:
print(
prediction["token_str"],
prediction["score"],
)
Direct Usage
from transformers import (
AutoTokenizer,
AutoModelForMaskedLM,
)
MODEL_ID = "rIsHu009/distilbert-imdb-mlm-accelerate"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForMaskedLM.from_pretrained(
MODEL_ID
)
Tokenizer
The checkpoint uses the standard uncased DistilBERT WordPiece tokenizer.
Tokenizer: DistilBertTokenizer
Vocabulary: 30,522 tokens
Maximum sequence length: 512
Lowercasing: enabled
Special tokens:
[PAD]
[UNK]
[CLS]
[SEP]
[MASK]
The preserved tokenizer configuration confirms the [MASK] token, lowercasing, and 512-token maximum sequence length.
MLM vs Sentiment Classification
IMDb is commonly associated with positive/negative sentiment classification, but this checkpoint represents a different learning objective.
Sentiment classification:
review
β
DistilBERT
β
2-class classifier
β
positive / negative
This checkpoint instead performs:
masked review
β
DistilBERT
β
vocabulary prediction head
β
predicted token
The distinction is important: this model should be loaded using AutoModelForMaskedLM, not AutoModelForSequenceClassification.
Trainer vs Accelerate
This experiment is intentionally preserved as a pair:
| Repository | Training approach |
|---|---|
distilbert-imdb-mlm-trainer |
Hugging Face Trainer |
distilbert-imdb-mlm-accelerate |
Accelerate/manual training workflow |
Trainer
The Trainer checkpoint preserves its original training hyperparameters and validation-loss history.
Accelerate
This checkpoint preserves the corresponding lower-level training workflow, with repository history showing progress through epoch 2.
Together, the repositories demonstrate two approaches to continued masked-language-model training.
Intended Use
This checkpoint is primarily useful for:
- masked-token prediction;
- studying masked language modeling;
- learning domain-oriented language-model adaptation;
- experimenting with movie-review text;
- learning Hugging Face Accelerate;
- studying explicit Transformer training loops;
- comparing Trainer and Accelerate workflows.
It is not intended as a sentiment classifier.
Limitations
The model:
- does not predict positive/negative sentiment;
- may produce incorrect or unusual masked-token predictions;
- may inherit biases from the original DistilBERT model;
- may inherit undesirable patterns from movie-review text;
- is not a general-purpose text-generation model;
- has not been validated for high-stakes applications.
Masked-token outputs should be treated as language-model predictions rather than factual answers.
Learning Context
This experiment was created during hands-on study of Hugging Face NLP and model-training workflows.
The pair captures the progression:
pretrained DistilBERT
β
masked language modeling
β
movie-review-domain adaptation
β
Trainer
β
Accelerate / explicit training loop
It complements other learning artifacts on this profile covering question answering, machine translation, causal language modeling, tokenization and Transformer training.
Repository Contents
The repository includes:
model.safetensorsconfig.jsontokenizer.jsontokenizer_config.jsonvocab.txt- special-token configuration
Companion Model
Trainer implementation
rIsHu009/distilbert-imdb-mlm-trainer
The companion repository preserves the higher-level Trainer workflow together with its historical training configuration and validation-loss progression.
Author
Naman Chanana
- Hugging Face:
rIsHu009 - GitHub:
Rishy-09
Educational masked-language-modeling artifact preserved as part of an ongoing study of NLP, LLMs, and the Hugging Face ecosystem.
- Downloads last month
- 11
Model tree for rIsHu009/distilbert-imdb-mlm-accelerate
Base model
distilbert/distilbert-base-uncased