Update app.py
Browse files
app.py
CHANGED
@@ -120,7 +120,8 @@ with gr.Blocks() as demo:
|
|
120 |
)
|
121 |
|
122 |
if __name__ == "__main__":
|
123 |
-
|
124 |
-
|
|
|
125 |
demo.queue(concurrency_count=2,
|
126 |
).launch()
|
|
|
120 |
)
|
121 |
|
122 |
if __name__ == "__main__":
|
123 |
+
# Check if CUDA is available
|
124 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
125 |
+
pipe = StableDiffusionPipeline.from_single_file(PATH,torch_dtype=torch.float16).to(device)
|
126 |
demo.queue(concurrency_count=2,
|
127 |
).launch()
|