blink-4b / graft_keys.py
thegovind's picture
Code revision v1.3: opt-in screenshot input (self-hosted)
400f1f6 verified
Raw History Blame
369 Bytes
"""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}")