Tips: | |
To convert the model, you need to clone the original repository using git clone https://github.com/persimmon-ai-labs/adept-inference, then get the checkpoints: | |
git clone https://github.com/persimmon-ai-labs/adept-inference | |
wget path/to/fuyu-8b-model-weights.tar | |
tar -xvf fuyu-8b-model-weights.tar | |
python src/transformers/models/fuyu/convert_fuyu_weights_to_hf.py --input_dir /path/to/downloaded/fuyu/weights/ --output_dir /output/path \ | |
--pt_model_path /path/to/fuyu_8b_release/iter_0001251/mp_rank_00/model_optim_rng.pt | |
--ada_lib_path /path/to/adept-inference | |
For the chat model: | |
wget https://axtkn4xl5cip.objectstorage.us-phoenix-1.oci.customer-oci.com/n/axtkn4xl5cip/b/adept-public-data/o/8b_chat_model_release.tar | |
tar -xvf 8b_base_model_release.tar | |
Then, model can be loaded via: | |
py | |
from transformers import FuyuConfig, FuyuForCausalLM | |
model_config = FuyuConfig() | |
model = FuyuForCausalLM(model_config).from_pretrained('/output/path') | |
Inputs need to be passed through a specific Processor to have the correct formats. |