amildravid4292 commited on
Commit
d2b8415
·
verified ·
1 Parent(s): 24c2a09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -83,6 +83,7 @@ thick.value = debias(thick.value, "Brown_Hair", df, pinverse, device.value)
83
  thick.value = debias(thick.value, "Pale_Skin", df, pinverse, device.value)
84
  thick.value = debias(thick.value, "Heavy_Makeup", df, pinverse, device.value)
85
 
 
86
  def sample_model():
87
  unet.value, _, _, _, _ = load_models(device.value)
88
  network.value = sample_weights(unet.value, proj, mean, std, v[:, :1000], device.value, factor = 1.00)
@@ -207,7 +208,8 @@ def edit_inference(prompt, negative_prompt, guidance_scale, ddim_steps, seed, st
207
  network.value.reset()
208
 
209
  return image
210
-
 
211
  @spaces.GPU
212
  def sample_then_run():
213
  sample_model()
 
83
  thick.value = debias(thick.value, "Pale_Skin", df, pinverse, device.value)
84
  thick.value = debias(thick.value, "Heavy_Makeup", df, pinverse, device.value)
85
 
86
+ @torch.no_grad()
87
  def sample_model():
88
  unet.value, _, _, _, _ = load_models(device.value)
89
  network.value = sample_weights(unet.value, proj, mean, std, v[:, :1000], device.value, factor = 1.00)
 
208
  network.value.reset()
209
 
210
  return image
211
+
212
+ @torch.no_grad()
213
  @spaces.GPU
214
  def sample_then_run():
215
  sample_model()