sharanyaswarup commited on
Commit
cdb8eff
Β·
1 Parent(s): 5d65432
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -357,7 +357,7 @@ css = """
357
  custom_theme = gr.themes.Soft(primary_hue="indigo", secondary_hue="slate", neutral_hue="slate", font=[gr.themes.GoogleFont("Inter"), "ui-sans-serif", "system-ui", "sans-serif"])
358
 
359
  # ── UI ────────────────────────────────────────────────────────────────────────
360
- with gr.Blocks(title="School Data Fetcher") as app:
361
  gr.Markdown("# 🏫 School Data Fetcher", elem_id="title")
362
  gr.Markdown("Select a state and categories below to get started.", elem_id="subtitle")
363
  with gr.Row():
@@ -398,10 +398,9 @@ with gr.Blocks(title="School Data Fetcher") as app:
398
 
399
 
400
  if __name__ == "__main__":
401
- launch_kwargs = dict(css=css, theme=custom_theme)
402
  if os.environ.get("SPACE_ID"):
403
  print("Starting on Hugging Face Spaces (0.0.0.0:7860) …")
404
- app.queue().launch(server_name="0.0.0.0", server_port=7860, **launch_kwargs)
405
  else:
406
- print("Starting on http://127.0.0.1:7861 …")
407
- app.queue().launch(server_name="127.0.0.1", server_port=7861, inbrowser=True, **launch_kwargs)
 
357
  custom_theme = gr.themes.Soft(primary_hue="indigo", secondary_hue="slate", neutral_hue="slate", font=[gr.themes.GoogleFont("Inter"), "ui-sans-serif", "system-ui", "sans-serif"])
358
 
359
  # ── UI ────────────────────────────────────────────────────────────────────────
360
+ with gr.Blocks(title="School Data Fetcher", css=css, theme=custom_theme) as app:
361
  gr.Markdown("# 🏫 School Data Fetcher", elem_id="title")
362
  gr.Markdown("Select a state and categories below to get started.", elem_id="subtitle")
363
  with gr.Row():
 
398
 
399
 
400
  if __name__ == "__main__":
 
401
  if os.environ.get("SPACE_ID"):
402
  print("Starting on Hugging Face Spaces (0.0.0.0:7860) …")
403
+ app.queue().launch(server_name="0.0.0.0", server_port=7860)
404
  else:
405
+ print("Starting locally …")
406
+ app.queue().launch(server_name="127.0.0.1", server_port=7861, inbrowser=True)