GaetanoParente commited on
Commit
0adf724
·
1 Parent(s): 96bc481
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -555,8 +555,10 @@ with gr.Blocks(title="NGT AI Platform", theme=theme, css_paths="style.css") as d
555
  )
556
 
557
  if __name__ == "__main__":
 
 
558
  demo.launch(
559
  server_name="0.0.0.0",
560
- server_port=7862,
561
  allowed_paths=["data"]
562
  )
 
555
  )
556
 
557
  if __name__ == "__main__":
558
+ is_hf_space = "SPACE_ID" in os.environ
559
+ port = int(os.environ.get("PORT", 7860)) if is_hf_space else 7862
560
  demo.launch(
561
  server_name="0.0.0.0",
562
+ server_port=port,
563
  allowed_paths=["data"]
564
  )