File size: 369 Bytes
400f1f6
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
"""Map merged text weights to their matching vision-language parent."""


def text_to_parent(key: str) -> str:
    if key == "lm_head.weight" or key.startswith("model.language_model."):
        return key
    if key.startswith("model."):
        return "model.language_model." + key[len("model."):]
    raise ValueError(f"unexpected key in the text checkpoint: {key}")