Download diffsynth/utils/state_dict_converters/qwen_image_text_encoder.py from ViTeX-Bench/ViTeX-Edit-14B: direct link, hf CLI and curl.
- Browser
- Download file 341 Bytes
-
https://huggingface.co/ViTeX-Bench/ViTeX-Edit-14B/resolve/c5afbf279998b75da844c19fb4182e8bf58df875/diffsynth/utils/state_dict_converters/qwen_image_text_encoder.py
- Command line
-
hf download hf://ViTeX-Bench/ViTeX-Edit-14B@c5afbf279998b75da844c19fb4182e8bf58df875/diffsynth/utils/state_dict_converters/qwen_image_text_encoder.py
-
curl -L -o qwen_image_text_encoder.py https://huggingface.co/ViTeX-Bench/ViTeX-Edit-14B/resolve/c5afbf279998b75da844c19fb4182e8bf58df875/diffsynth/utils/state_dict_converters/qwen_image_text_encoder.py
341 Bytes
| def QwenImageTextEncoderStateDictConverter(state_dict): | |
| state_dict_ = {} | |
| for k in state_dict: | |
| v = state_dict[k] | |
| if k.startswith("visual."): | |
| k = "model." + k | |
| elif k.startswith("model."): | |
| k = k.replace("model.", "model.language_model.") | |
| state_dict_[k] = v | |
| return state_dict_ | |