diff --git a/src/neuronx_distributed/scripts/checkpoint_converter.py b/src/neuronx_distributed/scripts/checkpoint_converter.py index d7c1329..cbffcb6 100644 --- a/src/neuronx_distributed/scripts/checkpoint_converter.py +++ b/src/neuronx_distributed/scripts/checkpoint_converter.py @@ -76,7 +76,9 @@ def download_and_save_hf_model(self, model_identifier, output_path="/home/ubuntu from transformers import AutoModelForCausalLM - token = getpass("Enter your Hugging Face API token: (If you don't have one, create it at https://huggingface.co/settings/tokens): ") + token = os.getenv("HF_TOKEN", None) + if token is None: + token = getpass("Enter your Hugging Face API token: (If you don't have one, create it at https://huggingface.co/settings/tokens): ") login(token=token) print(f"Downloading model: {model_identifier}")