Srikasi commited on
Commit
3092e54
·
verified ·
1 Parent(s): 9da14b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -127,13 +127,9 @@ with gr.Blocks(title="Astro-Diffusion: Base vs LoRA") as demo:
127
  )
128
 
129
 
130
- port = int(os.getenv("GRADIO_SERVER_PORT", "7861"))
131
- share = os.getenv("GRADIO_PUBLIC_SHARE", "False") == "True"
132
- demo.launch(
133
- server_name="0.0.0.0",
134
- server_port=port,
135
- show_error=True,
136
- share=share,
137
- )
138
-
139
 
 
127
  )
128
 
129
 
130
+ if __name__ == "__main__":
131
+ interface = build_ui()
132
+ port = int(os.getenv("PORT", os.getenv("GRADIO_SERVER_PORT", "7861")))
133
+ share = os.getenv("GRADIO_PUBLIC_SHARE", "True").lower() == "true"
134
+ interface.launch(server_name="0.0.0.0", server_port=port, share=share)
 
 
 
 
135