Skip to content

Commit

Permalink
commit change
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuck Tang committed Nov 21, 2024
2 parents 256f13d + a0d6375 commit 8681946
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/inference/convert_composer_mpt_to_ft.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def write_ft_checkpoint_from_composer_checkpoint(
# Extract the HF tokenizer
print('#' * 30)
print('Extracting HF Tokenizer...')
hf_tokenizer = get_hf_tokenizer_from_composer_state_dict(
hf_tokenizer = get_hf_tokenizer_from_composer_state_dict( # pyright: ignore
composer_state_dict,
trust_remote_code,
)
Expand All @@ -141,7 +141,7 @@ def write_ft_checkpoint_from_composer_checkpoint(

# Extract the model weights
weights_state_dict = composer_state_dict['state']['model']
torch.nn.modules.utils.consume_prefix_in_state_dict_if_present( # pyright: ignore
torch.nn.modules.utils.consume_prefix_in_state_dict_if_present( # pyright: ignore
weights_state_dict,
prefix='model.',
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/inference/convert_composer_to_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def write_huggingface_pretrained_from_composer_checkpoint(
weights_state_dict = composer_state_dict
if 'state' in weights_state_dict:
weights_state_dict = weights_state_dict['state']['model']
torch.nn.modules.utils.consume_prefix_in_state_dict_if_present( # pyright: ignore
torch.nn.modules.utils.consume_prefix_in_state_dict_if_present( # pyright: ignore
weights_state_dict,
prefix='model.',
)
Expand Down

0 comments on commit 8681946

Please sign in to comment.