Unverified Commit 3d08d8dc authored by Dhruv Nair's avatar Dhruv Nair Committed by GitHub
Browse files

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

fix loading custom text encoder when using from_single_file
parent bdc4c326
...@@ -783,6 +783,8 @@ def convert_ldm_clip_checkpoint(checkpoint, local_files_only=False, text_encoder ...@@ -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 ctx = init_empty_weights if is_accelerate_available() else nullcontext
with ctx(): with ctx():
text_model = CLIPTextModel(config) text_model = CLIPTextModel(config)
else:
text_model = text_encoder
keys = list(checkpoint.keys()) keys = list(checkpoint.keys())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment