mirror of
https://github.com/storytold/FineTrainers-Conditioning.git
synced 2026-10-09 00:09:45 +00:00
9ef58e2f3a
* rename files * ltx finetuning * update * update * improvements * make style * gradient clipping * update * fix distributed inference * update * update
9 lines
276 B
Python
9 lines
276 B
Python
from accelerate import Accelerator
|
|
from diffusers.utils.torch_utils import is_compiled_module
|
|
|
|
|
|
def unwrap_model(accelerator: Accelerator, model):
|
|
model = accelerator.unwrap_model(model)
|
|
model = model._orig_mod if is_compiled_module(model) else model
|
|
return model
|