Skip to content

JayRaj21/BERT-Pruning-Comparison

Repository files navigation

BERT Pruning Comparison

Applies and compares pruning techniques on a BERT model, then exports to ONNX and TFLite for edge deployment.

Techniques compared:

  • Unstructured pruning (magnitude-based)
  • Structured pruning
  • Sparsity analysis and reporting

Setup

python -m venv .bert_venv
source .bert_venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-gui.txt  # for GUI frontends only

Model

The base model (prajjwal1/bert-medium) is downloaded automatically from Hugging Face on first run via the transformers library. No manual download needed.

Usage

Run pruning and export:

python BERT-Optimization.py

Generate reports:

python generate_report.py
python generate_tflite_report.py

GUI frontends:

python bert_gui_streamlit.py   # Streamlit
python bert_gui_gradio.py      # Gradio
python bert_gui_tkinter.py     # Tkinter

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages