Skip to content

Commit 259d174

Browse files
authored
Fix Florence2 conversion script model_type KeyError (#41866)
hopefully fixed florence2_language keyerror
1 parent 38df1e9 commit 259d174

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/transformers/models/florence2/convert_florence2_original_pytorch_to_hf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,9 @@ def convert_florence2_checkpoint(hf_model_id, pytorch_dump_folder, output_hub_pa
473473

474474
vision_config = convert_config(hf_config.vision_config.__dict__)
475475
text_config = hf_config.text_config.__dict__
476+
if text_config.get("model_type") == "florence2_language":
477+
text_config["model_type"] = "bart"
478+
476479
config = Florence2Config(
477480
text_config=text_config,
478481
vision_config=vision_config,

0 commit comments

Comments
 (0)