-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
bugSomething isn't workingSomething isn't working
Description
System Info
- modalities version: main branch, 7cd60e2
- system: linux
- python version: 3.10.13
🐛 Describe the bug
The conversion of the checkpoint from the getting started example to HF fails.
Error Message:
AttributeError: 'HFModelAdapterConfig' object has no attribute 'config'
Steps to reproduce the error:
-
Run the getting started example:
cd tutorials/getting_started bash run_getting_started_example.sh 0 1 -
Create a config file
example_config_convert.yamlfor checkpoint conversion:- copy example config
cp example_config.yaml example_config_convert.yaml- change
settings.cuda_envinexample_config_convert.yamlto:
cuda_env: local_rank: 0 global_rank: 0 world_size: 1- append the following top level component to
example_config_convert.yaml:
checkpointed_model: component_key: model variant_key: checkpointed config: checkpoint_loading: component_key: checkpoint_loading variant_key: torch config: device: 0 precision: BF16 model: instance_key: model pass_type: BY_REFERENCE checkpoint_path: checkpoints/<path_to_checkpoint>.bin # needs to be adjusted to checkpoint created in step 1. -
Run checkpoint conversion:
CUDA_VISIBLE_DEVICES=0 modalities convert_pytorch_to_hf_checkpoint --config_file_path example_config_convert.yaml --output_hf_checkpoint_dir checkpoint.hf --prediction_key logits
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working