From ed343512f7d1888f39dd8f0305cbac2a19c401e7 Mon Sep 17 00:00:00 2001 From: v-chen_data Date: Tue, 10 Sep 2024 13:14:26 -0700 Subject: [PATCH] precommit --- llmfoundry/command_utils/eval.py | 4 +++- tests/a_scripts/inference/test_convert_composer_to_hf.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/llmfoundry/command_utils/eval.py b/llmfoundry/command_utils/eval.py index ea12bbb029..d554ba2b8c 100644 --- a/llmfoundry/command_utils/eval.py +++ b/llmfoundry/command_utils/eval.py @@ -99,7 +99,9 @@ def evaluate_model( mosaicml_logger.log_metrics(metadata) mosaicml_logger._flush_metadata(force_flush=True) - fsdp_config = parallelism_config.get('fsdp_config', None) if parallelism_config else None + fsdp_config = parallelism_config.get( + 'fsdp_config', None + ) if parallelism_config else None if fsdp_config and model.get('load_in_8bit', False): raise ValueError( 'The FSDP config block is not supported when loading ' + diff --git a/tests/a_scripts/inference/test_convert_composer_to_hf.py b/tests/a_scripts/inference/test_convert_composer_to_hf.py index c7d0b0d894..36bd7413da 100644 --- a/tests/a_scripts/inference/test_convert_composer_to_hf.py +++ b/tests/a_scripts/inference/test_convert_composer_to_hf.py @@ -922,7 +922,8 @@ def test_huggingface_conversion_callback( model=original_model, device='gpu', precision=trainer_precision, - parallelism_config={'fsdp': fsdp_config} if fsdp_state_dict_type is not None else None, + parallelism_config={'fsdp': fsdp_config} + if fsdp_state_dict_type is not None else None, train_dataloader=train_dataloader, save_folder=os.path.join(tmp_path, 'checkpoints'), save_interval=save_interval,