Implementation:Microsoft LoRA NLG Environment Setup Script
Appearance
Overview
NLG_Environment_Setup_Script provides the concrete commands for installing Python dependencies and downloading pretrained GPT-2 checkpoints required by the LoRA NLG fine-tuning pipeline. This implementation covers two shell-level entry points: pip install -r requirement.txt and bash download_pretrained_checkpoints.sh.
Type
External Tool Doc
Source
examples/NLG/requirement.txt(lines 1-7)examples/NLG/download_pretrained_checkpoints.sh(lines 1-11)
Signature
Dependency Installation
pip install -r requirement.txt
The requirement.txt file contains the following pinned dependencies:
--find-links https://download.pytorch.org/whl/torch_stable.html
torch==1.7.1+cu101
transformers==3.3.1
spacy
tqdm
tensorboard
progress
Checkpoint Download
bash download_pretrained_checkpoints.sh
The script performs the following operations:
#!/bin/bash
echo "downloading pretrained model checkpoints..."
mkdir pretrained_checkpoints
cd pretrained_checkpoints
wget https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-pytorch_model.bin
wget https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-medium-pytorch_model.bin
wget https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-large-pytorch_model.bin
cd ..
echo "script complete!"
Input / Output
| Direction | Description |
|---|---|
| Input | A clean Python environment (virtualenv or conda) with pip and wget available.
|
| Output |
|
Notes
- The
--find-linksdirective inrequirement.txtpoints pip to the PyTorch wheel index for CUDA 10.1 builds. If using a different CUDA version, modify this line accordingly. - The loralib package is not listed in
requirement.txtand must be installed separately, typically viapip install loralibor from the repository root. - The regex package is also required by the BPE encoder (
encoder.py) but is not listed in the requirements file. Install it viapip install regex.
Metadata
| Field | Value |
|---|---|
| Source | microsoft/LoRA |
| Type | External Tool Doc |
| Last Updated | 2026-02-10 |
Related
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment