File size: 289 Bytes
b347817
 
 
 
 
 
 
1
2
3
4
5
6
7
8
def SDTextEncoderStateDictConverter(state_dict):
    new_state_dict = {}
    for key in state_dict:
        if key.startswith("text_model.") and "position_ids" not in key:
            new_key = "model." + key
            new_state_dict[new_key] = state_dict[key]
    return new_state_dict