llm-foundry
llm-foundry copied to clipboard
new python file to upload mosaic-bert to hf
-
Added
convert_mosaicbert_to_hf.pyinsideinferencefolder. -
inference/convert_composer_to_hf.pywas 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_pathJSON, if not provided, it uses the config from mosaicml/mosaic-bert-base-Huggingface. It also downloads (via therequestspackage) some required scripts such asbert_layers.pyfrom there. -
Wasn't sure whether to PR on this repository or
mosaicml/examples. Decided to do it here since my script needs thellmfoundrypackage anyway. -
Solves https://github.com/mosaicml/examples/issues/445 and https://github.com/mosaicml/examples/issues/401#issuecomment-1629846290