MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / unwrap_model

Function unwrap_model

diffusers/examples/controlnet/train_controlnet.py:821–824  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

819
820 # Taken from [Sayak Paul's Diffusers PR #6511](https://github.com/huggingface/diffusers/pull/6511/files)
821 def unwrap_model(model):
822 model = accelerator.unwrap_model(model)
823 model = model._orig_mod if is_compiled_module(model) else model
824 return model
825
826 # `accelerate` 0.16.0 will have better support for customized saving
827 if version.parse(accelerate.__version__) >= version.parse("0.16.0"):

Callers 1

mainFunction · 0.70

Calls 1

is_compiled_moduleFunction · 0.90

Tested by

no test coverage detected