Skip to content

Commit

Permalink
Make s3 imports try-except and separate requirements to s3 file
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-Anthony committed Sep 23, 2023
1 parent 4e548a4 commit 3d76d4f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions megatron/checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@
import sys
import numpy as np

import boto3
import hf_transfer
try:
import boto3
except ModuleNotFoundError:
print("For s3 checkpointing, please install boto3 either using requirements/requirements-s3.txt or https://github.com/boto/boto3")
try:
import hf_transfer
except ModuleNotFoundError:
print("For s3 checkpointing, please install hf_transfer either using requirements/requirements-s3.txt or https://github.com/huggingface/hf_transfer")
import torch
from glob import glob

Expand Down
2 changes: 2 additions & 0 deletions requirements/requirements-s3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hf-transfer>=0.1.3
boto3
1 change: 0 additions & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ git+https://github.com/EleutherAI/DeeperSpeed.git#egg=deepspeed
ftfy>=6.0.1
git+https://github.com/EleutherAI/lm_dataformat.git@4eec05349977071bf67fc072290b95e31c8dd836
huggingface_hub>=0.11.0
hf-transfer>=0.1.3
lm_eval>=0.3.0
mpi4py>=3.0.3
numpy>=1.22.0
Expand Down

0 comments on commit 3d76d4f

Please sign in to comment.