1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

fix loading custom text encoder when using from_single_file (#4571)

fix loading custom text encoder when using from_single_file
This commit is contained in:
Dhruv Nair
2023-08-17 08:41:09 +05:30
committed by GitHub
parent bdc4c3265f
commit 3d08d8dc4e

View File

@@ -783,6 +783,8 @@ def convert_ldm_clip_checkpoint(checkpoint, local_files_only=False, text_encoder
ctx = init_empty_weights if is_accelerate_available() else nullcontext
with ctx():
text_model = CLIPTextModel(config)
else:
text_model = text_encoder
keys = list(checkpoint.keys())