Himanshu-AT commited on
Commit
b78ca95
·
1 Parent(s): 72cab49
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -79,7 +79,7 @@ pipe.enable_lora()
79
 
80
  # return width, height
81
 
82
- @spaces.GPU(durations=300)
83
  def infer(edit_images, prompt, prompt2, width, height, seed=42, randomize_seed=False, guidance_scale=3.5, num_inference_steps=28, progress=gr.Progress(track_tqdm=True)):
84
  # pipe.enable_xformers_memory_efficient_attention()
85
 
@@ -214,10 +214,15 @@ with gr.Blocks(css=css) as demo:
214
  )
215
 
216
  # demo.launch()
217
- password = os.getenv("GRADIO_PASSWORD")
218
-
219
  # Create an authentication object
220
- auth = gr.Auth(username="user", password=password)
 
 
221
 
 
 
222
  # Launch the app with authentication
223
- demo.launch(auth=auth)
 
 
79
 
80
  # return width, height
81
 
82
+ # @spaces.GPU(durations=300)
83
  def infer(edit_images, prompt, prompt2, width, height, seed=42, randomize_seed=False, guidance_scale=3.5, num_inference_steps=28, progress=gr.Progress(track_tqdm=True)):
84
  # pipe.enable_xformers_memory_efficient_attention()
85
 
 
214
  )
215
 
216
  # demo.launch()
217
+ PASSWORD = os.getenv("GRADIO_PASSWORD")
218
+ USERNAME = os.getenv("GRADIO_USERNAME")
219
  # Create an authentication object
220
+ def authenticate(username, password):
221
+ if username == USERNAME and password == PASSWORD:
222
+ return True
223
 
224
+ else:
225
+ return False
226
  # Launch the app with authentication
227
+
228
+ demo.launch(auth=authenticate)