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

Function unwrap_model

diffusers/examples/controlnet/train_controlnet_sd3.py:1010–1013  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

1008
1009 # Taken from [Sayak Paul's Diffusers PR #6511](https://github.com/huggingface/diffusers/pull/6511/files)
1010 def unwrap_model(model):
1011 model = accelerator.unwrap_model(model)
1012 model = model._orig_mod if is_compiled_module(model) else model
1013 return model
1014
1015 # `accelerate` 0.16.0 will have better support for customized saving
1016 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