mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-03 10:06:44 +00:00
[example] support Dreamblooth (#2188)
This commit is contained in:
21
examples/images/dreambooth/debug.py
Normal file
21
examples/images/dreambooth/debug.py
Normal file
@@ -0,0 +1,21 @@
|
||||
'''
|
||||
torchrun --standalone --nproc_per_node=1 debug.py
|
||||
'''
|
||||
|
||||
from diffusers import AutoencoderKL
|
||||
|
||||
import colossalai
|
||||
from colossalai.utils.model.colo_init_context import ColoInitContext, post_process_colo_init_ctx
|
||||
|
||||
path = "/data/scratch/diffuser/stable-diffusion-v1-4"
|
||||
|
||||
colossalai.launch_from_torch(config={})
|
||||
with ColoInitContext(device='cpu'):
|
||||
vae = AutoencoderKL.from_pretrained(
|
||||
path,
|
||||
subfolder="vae",
|
||||
revision=None,
|
||||
)
|
||||
|
||||
for n, p in vae.named_parameters():
|
||||
print(n)
|
Reference in New Issue
Block a user