ford442 commited on
Commit
d3850c1
·
verified ·
1 Parent(s): 00c5dc5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -203,8 +203,8 @@ def load_and_prepare_model():
203
  pipe.watermark=None
204
  pipe.safety_checker=None
205
  #pipe.to(torch.device('cuda:0'), torch.bfloat16)
 
206
  pipe.to(accelerator.device)
207
-
208
  return pipe
209
 
210
  #hidet.option.parallel_build(False)
@@ -272,7 +272,8 @@ def generate_30(
272
  filename = uploadNote(prompt,num_inference_steps,guidance_scale,timestamp)
273
  upload_to_ftp(filename)
274
  batch_options = options.copy()
275
- rv_image = pipe(**batch_options).images[0]
 
276
  sd_image_path = f"rv_C_{timestamp}.png"
277
  rv_image.save(sd_image_path,optimize=False,compress_level=0)
278
  upload_to_ftp(sd_image_path)
 
203
  pipe.watermark=None
204
  pipe.safety_checker=None
205
  #pipe.to(torch.device('cuda:0'), torch.bfloat16)
206
+ pipe.to(torch.bfloat16)
207
  pipe.to(accelerator.device)
 
208
  return pipe
209
 
210
  #hidet.option.parallel_build(False)
 
272
  filename = uploadNote(prompt,num_inference_steps,guidance_scale,timestamp)
273
  upload_to_ftp(filename)
274
  batch_options = options.copy()
275
+ with accelerator.autocast():
276
+ rv_image = pipe(**batch_options).images[0]
277
  sd_image_path = f"rv_C_{timestamp}.png"
278
  rv_image.save(sd_image_path,optimize=False,compress_level=0)
279
  upload_to_ftp(sd_image_path)