Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/cicd-main-speech.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
runner: self-hosted-azure-gpus-1
timeout: 30
- script: L0_Unit_Tests_CPU_ASR
runner: self-hosted-azure-cpu
runner: azure-gpu-vm-runner1-cpu
cpu-only: true
timeout: 20
- script: L0_Unit_Tests_GPU_TTS
Expand Down Expand Up @@ -180,6 +180,7 @@ jobs:
script: SPEECHLM_HF_Training_DuplexS2SSpeechDecoder
- runner: self-hosted-azure
script: SPEECHLM_HF_Training_SALM
timeout: 20
needs: [unit-tests]
runs-on: ${{ matrix.runner }}
name: ${{ matrix.is-optional && 'PLEASEFIXME_' || '' }}${{ matrix.script }}
Expand All @@ -195,4 +196,5 @@ jobs:
script: ${{ matrix.script }}
tests_to_run: ${{ inputs.test_to_run }}
image: ${{ inputs.image-name }}
timeout: ${{ matrix.timeout || 10 }}
is_optional: ${{ matrix.is-optional || false }}
19 changes: 17 additions & 2 deletions nemo/core/connectors/save_restore_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,23 @@ def _save_state_dict_to_disk(state_dict, filepath):
torch.save(state_dict, filepath)

@staticmethod
def _load_state_dict_from_disk(model_weights, map_location=None):
return torch.load(model_weights, map_location='cpu', weights_only=False)
def _load_state_dict_from_disk(model_weights, map_location='cpu'):
"""
Load model state dict from disk.

Args:
model_weights: Path to the checkpoint file
map_location: Device to map tensors to

Returns:
State dict loaded from checkpoint

"""
try:
return torch.load(model_weights, map_location=map_location, weights_only=True)
except Exception as e:
logging.error(f"Failed to load checkpoint with weights_only=True: {e}")
raise e

@property
def model_config_yaml(self) -> str:
Expand Down
Loading