Fix import error (#146)

This commit is contained in:
Chenlei Hu 2024-02-09 04:02:33 +00:00 committed by GitHub
parent 61db0fba41
commit ed60a99826
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,6 @@ import ldm_patched.modules.ops as ops
from ldm_patched.modules.model_patcher import ModelPatcher from ldm_patched.modules.model_patcher import ModelPatcher
from ldm_patched.modules import model_management from ldm_patched.modules import model_management
from modules_forge.ops import use_patched_ops
from transformers import modeling_utils from transformers import modeling_utils
@ -17,7 +16,7 @@ class DiffusersModelPatcher:
self.dtype = dtype self.dtype = dtype
with use_patched_ops(ops.manual_cast): with ops.use_patched_ops(ops.manual_cast):
with modeling_utils.no_init_weights(): with modeling_utils.no_init_weights():
self.pipeline = pipeline_class.from_pretrained(*args, **kwargs) self.pipeline = pipeline_class.from_pretrained(*args, **kwargs)