prithivMLmods commited on
Commit
2d88a9a
Β·
verified Β·
1 Parent(s): 0658bb9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -1,4 +1,3 @@
1
- import spaces
2
  import gradio as gr
3
  import torch
4
  from PIL import Image
@@ -84,10 +83,9 @@ def generate(
84
  lora_repo = LORA_OPTIONS[lora_choice]["lora_repo"]
85
  trigger_word = LORA_OPTIONS[lora_choice]["trigger_word"]
86
 
87
- # Load LoRA weights and move them to GPU
88
  pipe.load_lora_weights(lora_repo)
89
- pipe.unet.to("cuda") # Move UNet to GPU
90
- pipe.text_encoder.to("cuda") # Move text encoder to GPU
91
 
92
  if trigger_word:
93
  positive_prompt = f"{trigger_word} {positive_prompt}"
@@ -230,4 +228,4 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
230
  )
231
 
232
  if __name__ == "__main__":
233
- demo.queue(max_size=40).launch()
 
 
1
  import gradio as gr
2
  import torch
3
  from PIL import Image
 
83
  lora_repo = LORA_OPTIONS[lora_choice]["lora_repo"]
84
  trigger_word = LORA_OPTIONS[lora_choice]["trigger_word"]
85
 
86
+ # Load LoRA weights and move the entire pipeline to GPU
87
  pipe.load_lora_weights(lora_repo)
88
+ pipe.to("cuda") # Move the entire pipeline to GPU
 
89
 
90
  if trigger_word:
91
  positive_prompt = f"{trigger_word} {positive_prompt}"
 
228
  )
229
 
230
  if __name__ == "__main__":
231
+ demo.queue(max_size=40).launch(share=True) # Set share=True to create a public link