Yaron Koresh commited on
Commit
56ee7db
·
verified ·
1 Parent(s): 0e708c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -208,13 +208,8 @@ function custom(){
208
  }
209
  """
210
 
211
- if __name__ == "__main__":
212
-
213
- port_inc()
214
- _dynamo.config.suppress_errors = True
215
- mp.set_start_method("spawn", force=True)
216
  result = []
217
-
218
  with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
219
  with gr.Column(elem_id="col-container"):
220
  gr.Markdown(f"""
@@ -242,4 +237,10 @@ if __name__ == "__main__":
242
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
243
 
244
  run_button.click(fn=main,inputs=[prompt,prompt2],outputs=result)
245
- demo.queue().launch(server_port=int(os.getenv("CUSTOM_PORT")))
 
 
 
 
 
 
 
208
  }
209
  """
210
 
211
+ def ui():
 
 
 
 
212
  result = []
 
213
  with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
214
  with gr.Column(elem_id="col-container"):
215
  gr.Markdown(f"""
 
237
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
238
 
239
  run_button.click(fn=main,inputs=[prompt,prompt2],outputs=result)
240
+ demo.queue().launch(server_port=int(os.getenv("CUSTOM_PORT")))
241
+
242
+ mp.set_start_method("spawn", force=True)
243
+ ui()
244
+ if __name__ == "__main__":
245
+ port_inc()
246
+ _dynamo.config.suppress_errors = True