ford442 commited on
Commit
f908fda
·
verified ·
1 Parent(s): e60945f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -110,12 +110,15 @@ def load_and_prepare_model():
110
  #pipe.unet.to(memory_format=torch.channels_last)
111
  #pipe.enable_vae_tiling()
112
  pipe.to(device=device, dtype=torch.bfloat16)
 
113
  pipe.unet.set_attn_processor(AttnProcessor2_0())
114
  for name, param in pipe.unet.named_parameters():
115
  if 'qkv' in name or 'norm' in name or 'proj' in name:
116
  param.requires_grad_()
117
  else:
118
  param.requires_grad_(False)
 
 
119
  return pipe
120
 
121
  pipe = load_and_prepare_model()
 
110
  #pipe.unet.to(memory_format=torch.channels_last)
111
  #pipe.enable_vae_tiling()
112
  pipe.to(device=device, dtype=torch.bfloat16)
113
+ '''
114
  pipe.unet.set_attn_processor(AttnProcessor2_0())
115
  for name, param in pipe.unet.named_parameters():
116
  if 'qkv' in name or 'norm' in name or 'proj' in name:
117
  param.requires_grad_()
118
  else:
119
  param.requires_grad_(False)
120
+ '''
121
+ pipe.unet.requires_grad_(False)
122
  return pipe
123
 
124
  pipe = load_and_prepare_model()