Sabbirr12 commited on
Commit
f606051
·
verified ·
1 Parent(s): 34c5a60

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -7,10 +7,10 @@ from PIL import Image
7
 
8
  app = FastAPI()
9
 
10
- # Safe GPU detection
11
- device = "cuda" if torch.cuda.is_available() else "cpu"
12
- dtype = torch.float16 if device == "cuda" else torch.float32
13
- variant = "fp16" if device == "cuda" else None
14
 
15
  # Load text-to-image model
16
  text2img_pipe = StableDiffusionPipeline.from_pretrained(
 
7
 
8
  app = FastAPI()
9
 
10
+ # Force CPU setup
11
+ device = "cpu"
12
+ dtype = torch.float32
13
+ variant = None # Don't use "fp16" on CPU
14
 
15
  # Load text-to-image model
16
  text2img_pipe = StableDiffusionPipeline.from_pretrained(