Skip to content

Commit

Permalink
minor missing key fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Patchwork53 committed Apr 13, 2024
1 parent 6659531 commit f29191d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 289 deletions.
286 changes: 0 additions & 286 deletions convert_mosaicbert_to_hf.py

This file was deleted.

6 changes: 3 additions & 3 deletions scripts/inference/convert_mosaicbert_to_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ def write_huggingface_pretrained_from_composer_checkpoint(
#json
with open(bert_config_path, 'r') as f:
bert_config = json.load(f)
composer_state_dict["state"]["integrations"]["huggingface"]["model"]["config"]["content"] = bert_config
composer_state_dict["state"]["integrations"] = {"huggingface":{"model":{"config":{"content": bert_config}}}}

else:
# placeholder config from mosaicml/mosaic-bert-base
composer_state_dict["state"]["integrations"]["huggingface"] = {
composer_state_dict["state"]["integrations"]={"huggingface":{
"model":{"config":{"content":{
"_name_or_path": "mosaicml/mosaic-bert",
"alibi_starting_size": 512,
Expand Down Expand Up @@ -118,7 +118,7 @@ def write_huggingface_pretrained_from_composer_checkpoint(
"use_cache": False,
"vocab_size": 30522

}}},
}}}},
"tokenizer":{}
}
if 'state' not in composer_state_dict:
Expand Down

0 comments on commit f29191d

Please sign in to comment.