Skip to content

Commit a6b822a

Browse files
SurbhiJainUSCGoogle-ML-Automation
authored andcommitted
Move torch installation and remove safetensors from checkpoint conversion guides
PiperOrigin-RevId: 930625456
1 parent 518ad8d commit a6b822a

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

docs/guides/checkpointing_solutions/convert_checkpoint.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ Use the `to_maxtext.py` script to convert a Hugging Face model checkpoint into a
3636
### Setup Environment
3737

3838
```bash
39-
# Install PyTorch and safetensors (in MaxText virtual environment)
40-
python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu
41-
python3 -m pip install safetensors --no-deps
42-
4339
# Setup environment variables
4440
export MODEL=<HF_MODEL> # e.g. 'llama3.1-8b-Instruct'
4541
export BASE_OUTPUT_DIRECTORY=<CKPT_PATH> # e.g., gs://my-bucket/my-checkpoint-directory
@@ -87,10 +83,6 @@ Use the `to_huggingface.py` script to convert a MaxText checkpoint into the Hugg
8783
### Setup Environment
8884

8985
```bash
90-
# Install PyTorch and safetensors (in MaxText virtual environment)
91-
python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu
92-
python3 -m pip install safetensors --no-deps
93-
9486
# Setup environment variables
9587
export MODEL=<MODEL_NAME> # e.g. 'qwen3-4b'
9688
export MAXTEXT_CKPT_PATH=<CKPT_PATH> # e.g., gs://my-bucket/my-model-checkpoint/0/items
@@ -136,6 +128,9 @@ To ensure the conversion was successful, you can use the [test script](https://g
136128
export MODEL=<MODEL_NAME> # e.g. 'qwen3-4b'
137129
export MAXTEXT_CKPT_PATH=<CKPT_PATH> # e.g., gs://my-bucket/my-model-checkpoint/0/items
138130
export HF_CKPT_PATH=<HF_CKPT_PATH> # e.g., gs://my-bucket/my-checkpoint-directory
131+
132+
# Install PyTorch (in MaxText virtual environment)
133+
python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu
139134
```
140135

141136
### Run Correctness Test

0 commit comments

Comments
 (0)