Skip to content

Commit

Permalink
daniel comments
Browse files Browse the repository at this point in the history
  • Loading branch information
v-chen_data committed Sep 24, 2024
1 parent e43b8a8 commit ef0bedb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion llmfoundry/callbacks/hf_checkpointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def tensor_hook(
del new_base_model_instance
else:
new_model_instance = type(original_model)(new_config)
if new_model_instance.generation_config != None:
if new_model_instance.generation_config is not None:
new_model_instance.generation_config.update(
**original_model.generation_config.to_dict(),
)
Expand Down
15 changes: 6 additions & 9 deletions tests/a_scripts/inference/test_convert_composer_to_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1675,12 +1675,9 @@ def __init__(self, config: PretrainedConfig):
save_interval='1ba',
)

try:
checkpointer._save_checkpoint(
state=state,
logger=logger,
upload_to_save_folder=False,
register_to_mlflow=False,
)
except Exception as e:
print(f'Test failed: {e} when generation_config is {generation_config}')
checkpointer._save_checkpoint(
state=state,
logger=logger,
upload_to_save_folder=False,
register_to_mlflow=False,
)

0 comments on commit ef0bedb

Please sign in to comment.