Skip to content

Environment and Setup

Sudhanshu edited this page Nov 11, 2026 · 1 revision

Environment and installation

Supported execution styles

  • Windows 11 PowerShell / VS Code terminal
  • Linux or macOS terminal
  • JupyterLab / Google Colab

Python 3.11 or 3.12 is a sensible starting point. A GPU is optional. The initial model/tokenizer download requires internet access unless already cached.

Recommended focused installation

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements-classifier.txt
python -m pip check

On Linux/macOS, activate with source .venv/bin/activate instead.

The uploaded requirements.txt is preserved unchanged for provenance. It includes peft, trl, and bitsandbytes, which are not imported by this DistilBERT classifier, so requirements-classifier.txt is preferable for this application.

For a CUDA-enabled PyTorch wheel, use the official selector at https://pytorch.org/get-started/locally/ rather than assuming a generic pip install torch will provide GPU support.

python -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"

Version compatibility with all future Transformers releases is not guaranteed; the source includes compatibility checks for several Trainer argument names.

Clone this wiki locally