KheemDH commited on
Commit
6d80f3d
Β·
1 Parent(s): 5690efa

Change model precision to float32 for CPU compatibility

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -10,7 +10,7 @@ from SegBody import segment_body # Import the segmentation function
10
  # Check if CUDA is available and set the device accordingly
11
  device = "cuda" if torch.cuda.is_available() else "cpu"
12
 
13
- # Load models with correct precision for CPU or GPU
14
  if device == "cuda":
15
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16) # Use fp16 for GPU
16
  pipeline = AutoPipelineForInpainting.from_pretrained(
 
10
  # Check if CUDA is available and set the device accordingly
11
  device = "cuda" if torch.cuda.is_available() else "cpu"
12
 
13
+ # Load models with the correct precision based on the device
14
  if device == "cuda":
15
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16) # Use fp16 for GPU
16
  pipeline = AutoPipelineForInpainting.from_pretrained(