cocktailpeanut commited on
Commit
b57a423
1 Parent(s): d230c07
Files changed (2) hide show
  1. app.py +8 -2
  2. requirements.txt +2 -1
app.py CHANGED
@@ -59,7 +59,13 @@ with open("defaults_data.json", "r") as file:
59
  lora_defaults = json.load(file)
60
 
61
 
62
- device = "cuda"
 
 
 
 
 
 
63
 
64
  state_dicts = {}
65
 
@@ -468,4 +474,4 @@ with gr.Blocks(css="custom.css") as demo:
468
  share_button.click(None, [], [], js=share_js)
469
  demo.load(fn=classify_gallery, inputs=[gr_sdxl_loras], outputs=[gallery, gr_sdxl_loras], queue=False, js=js)
470
  demo.queue(max_size=20)
471
- demo.launch(share=True)
 
59
  lora_defaults = json.load(file)
60
 
61
 
62
+ #device = "cuda"
63
+ if torch.cuda.is_available():
64
+ device = "cuda"
65
+ elif torch.backends.mps.is_available():
66
+ device = "mps"
67
+ else:
68
+ device = "cpu"
69
 
70
  state_dicts = {}
71
 
 
474
  share_button.click(None, [], [], js=share_js)
475
  demo.load(fn=classify_gallery, inputs=[gr_sdxl_loras], outputs=[gallery, gr_sdxl_loras], queue=False, js=js)
476
  demo.queue(max_size=20)
477
+ demo.launch(share=True)
requirements.txt CHANGED
@@ -9,4 +9,5 @@ gdown
9
  onnxruntime-gpu
10
  peft
11
  compel
12
- gradio_imageslider
 
 
9
  onnxruntime-gpu
10
  peft
11
  compel
12
+ gradio_imageslider
13
+ gradio