llm-foundry icon indicating copy to clipboard operation
llm-foundry copied to clipboard

new python file to upload mosaic-bert to hf

Open Patchwork53 opened this issue 1 year ago • 0 comments

  • Added convert_mosaicbert_to_hf.py inside inference folder.

  • inference/convert_composer_to_hf.py was only able to convert MPT and other CausalLMs to HF. Adapted that code to work on mosaic_bert

  • The python script takes in an optional bert_config_path JSON, if not provided, it uses the config from mosaicml/mosaic-bert-base-Huggingface. It also downloads (via the requests package) some required scripts such as bert_layers.py from there.

  • Wasn't sure whether to PR on this repository or mosaicml/examples. Decided to do it here since my script needs the llmfoundry package anyway.

  • Solves https://github.com/mosaicml/examples/issues/445 and https://github.com/mosaicml/examples/issues/401#issuecomment-1629846290

Patchwork53 avatar Apr 12 '24 09:04 Patchwork53