euler314 commited on
Commit
0b801f0
·
verified ·
1 Parent(s): 8222f9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -1325,11 +1325,11 @@ merged_data = merge_data(oni_long, typhoon_max)
1325
  logging.info("Data loading complete.")
1326
 
1327
  # -----------------------------
1328
- # Gradio Interface
1329
  # -----------------------------
1330
 
1331
- # Fix the Gradio interface creation with explicit configuration
1332
- with gr.Blocks(title="Typhoon Analysis Dashboard", theme=gr.themes.Default()) as demo:
1333
  gr.Markdown("# Typhoon Analysis Dashboard")
1334
 
1335
  with gr.Tab("Overview"):
@@ -1361,7 +1361,7 @@ with gr.Blocks(title="Typhoon Analysis Dashboard", theme=gr.themes.Default()) as
1361
  enso_phase = gr.Dropdown(label="ENSO Phase", choices=['all', 'El Nino', 'La Nina', 'Neutral'], value='all')
1362
  typhoon_search = gr.Textbox(label="Typhoon Search")
1363
  analyze_btn = gr.Button("Generate Tracks")
1364
- tracks_plot = gr.Plot(label="Typhoon Tracks", elem_id="tracks_plot")
1365
  typhoon_count = gr.Textbox(label="Number of Typhoons Displayed")
1366
  analyze_btn.click(fn=get_full_tracks,
1367
  inputs=[start_year, start_month, end_year, end_month, enso_phase, typhoon_search],
@@ -1421,7 +1421,8 @@ with gr.Blocks(title="Typhoon Analysis Dashboard", theme=gr.themes.Default()) as
1421
  typhoon_dropdown = gr.Dropdown(label="Tropical Cyclone")
1422
  standard_dropdown = gr.Dropdown(label="Classification Standard", choices=['atlantic', 'taiwan'], value='atlantic')
1423
  animate_btn = gr.Button("Generate Animation")
1424
- path_video = gr.Video(label="Tropical Cyclone Path Animation", format="mp4", interactive=False, elem_id="path_video")
 
1425
  animation_info = gr.Markdown("""
1426
  ### Animation Instructions
1427
  1. Select a year.
@@ -1455,6 +1456,6 @@ with gr.Blocks(title="Typhoon Analysis Dashboard", theme=gr.themes.Default()) as
1455
  inputs=[tsne_start_year, tsne_start_month, tsne_end_year, tsne_end_month, tsne_enso_phase, tsne_season],
1456
  outputs=[tsne_plot, routes_plot, stats_plot, cluster_info])
1457
 
 
1458
  if __name__ == "__main__":
1459
- # Remove the share parameter for HuggingFace Spaces
1460
  demo.launch()
 
1325
  logging.info("Data loading complete.")
1326
 
1327
  # -----------------------------
1328
+ # FIXED Gradio Interface
1329
  # -----------------------------
1330
 
1331
+ # Fixed Gradio interface creation
1332
+ with gr.Blocks(title="Typhoon Analysis Dashboard") as demo:
1333
  gr.Markdown("# Typhoon Analysis Dashboard")
1334
 
1335
  with gr.Tab("Overview"):
 
1361
  enso_phase = gr.Dropdown(label="ENSO Phase", choices=['all', 'El Nino', 'La Nina', 'Neutral'], value='all')
1362
  typhoon_search = gr.Textbox(label="Typhoon Search")
1363
  analyze_btn = gr.Button("Generate Tracks")
1364
+ tracks_plot = gr.Plot(label="Typhoon Tracks")
1365
  typhoon_count = gr.Textbox(label="Number of Typhoons Displayed")
1366
  analyze_btn.click(fn=get_full_tracks,
1367
  inputs=[start_year, start_month, end_year, end_month, enso_phase, typhoon_search],
 
1421
  typhoon_dropdown = gr.Dropdown(label="Tropical Cyclone")
1422
  standard_dropdown = gr.Dropdown(label="Classification Standard", choices=['atlantic', 'taiwan'], value='atlantic')
1423
  animate_btn = gr.Button("Generate Animation")
1424
+ # Fixed Video component - removed format and elem_id parameters
1425
+ path_video = gr.Video(label="Tropical Cyclone Path Animation", interactive=False)
1426
  animation_info = gr.Markdown("""
1427
  ### Animation Instructions
1428
  1. Select a year.
 
1456
  inputs=[tsne_start_year, tsne_start_month, tsne_end_year, tsne_end_month, tsne_enso_phase, tsne_season],
1457
  outputs=[tsne_plot, routes_plot, stats_plot, cluster_info])
1458
 
1459
+ # Fixed launch command
1460
  if __name__ == "__main__":
 
1461
  demo.launch()