MMADS commited on
Commit
faf5f63
·
1 Parent(s): 6b7cbd6

crash fix attempt

Browse files
Files changed (4) hide show
  1. .github/workflows/sync-to-hf.yml +1 -1
  2. README.md +1 -1
  3. app.py +11 -9
  4. requirements.txt +8 -4
.github/workflows/sync-to-hf.yml CHANGED
@@ -8,7 +8,7 @@ jobs:
8
  sync-to-hub:
9
  runs-on: ubuntu-latest
10
  steps:
11
- - uses: actions/checkout@v3
12
  with:
13
  fetch-depth: 0
14
  lfs: true
 
8
  sync-to-hub:
9
  runs-on: ubuntu-latest
10
  steps:
11
+ - uses: actions/checkout@v4
12
  with:
13
  fetch-depth: 0
14
  lfs: true
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🛡️
4
  colorFrom: pink
5
  colorTo: green
6
  sdk: gradio
7
- sdk_version: 5.44.1
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
4
  colorFrom: pink
5
  colorTo: green
6
  sdk: gradio
7
+ sdk_version: 6.14.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
app.py CHANGED
@@ -480,7 +480,8 @@ def create_interface():
480
  """Create the Gradio interface."""
481
  dashboard = CVEDashboard()
482
 
483
- with gr.Blocks(title="CVE Dashboard", theme=gr.themes.Soft()) as interface:
 
484
  # State to store fetched CVEs
485
  cve_state = gr.State([])
486
 
@@ -513,9 +514,9 @@ def create_interface():
513
  )
514
 
515
  severity_filter = gr.Dropdown(
516
- choices=[None, "CRITICAL", "HIGH", "MEDIUM", "LOW"],
517
  label="Severity Filter",
518
- value=None
519
  )
520
 
521
  fetch_btn = gr.Button("🔍 Fetch CVEs", variant="primary")
@@ -631,7 +632,7 @@ def create_interface():
631
  cves, status = dashboard.fetch_cves(
632
  year=year,
633
  keyword=keyword_search if keyword_search else None,
634
- severity=severity if severity else None
635
  )
636
 
637
  if cves:
@@ -744,11 +745,11 @@ def create_interface():
744
  outputs=[tailored_summary, generation_status]
745
  )
746
 
747
- # Load initial data
 
748
  interface.load(
749
- fn=fetch_and_display,
750
- inputs=[year_filter, keyword, severity_filter],
751
- outputs=[cve_state, status_text, cve_table, severity_chart, timeline_chart, score_chart, cve_selector]
752
  )
753
 
754
  return interface
@@ -769,4 +770,5 @@ if __name__ == "__main__":
769
 
770
  # Create and launch the interface
771
  app = create_interface()
772
- app.launch()
 
 
480
  """Create the Gradio interface."""
481
  dashboard = CVEDashboard()
482
 
483
+ # theme moved to launch() gr.Blocks() no longer accepts it in Gradio 6.x
484
+ with gr.Blocks(title="CVE Dashboard") as interface:
485
  # State to store fetched CVEs
486
  cve_state = gr.State([])
487
 
 
514
  )
515
 
516
  severity_filter = gr.Dropdown(
517
+ choices=["All", "CRITICAL", "HIGH", "MEDIUM", "LOW"],
518
  label="Severity Filter",
519
+ value="All"
520
  )
521
 
522
  fetch_btn = gr.Button("🔍 Fetch CVEs", variant="primary")
 
632
  cves, status = dashboard.fetch_cves(
633
  year=year,
634
  keyword=keyword_search if keyword_search else None,
635
+ severity=severity if severity and severity != "All" else None
636
  )
637
 
638
  if cves:
 
745
  outputs=[tailored_summary, generation_status]
746
  )
747
 
748
+ # Removed auto-fetch on load — it caused the HF Space healthcheck timeout crash.
749
+ # The server now binds immediately; user clicks "Fetch CVEs" to load data.
750
  interface.load(
751
+ fn=lambda: "👆 Select filters above and click 'Fetch CVEs' to load data.",
752
+ outputs=[status_text]
 
753
  )
754
 
755
  return interface
 
770
 
771
  # Create and launch the interface
772
  app = create_interface()
773
+ # theme moved from gr.Blocks() to launch() in Gradio 6.x
774
+ app.launch(server_name="0.0.0.0", server_port=7860, show_error=True, theme=gr.themes.Soft())
requirements.txt CHANGED
@@ -1,4 +1,8 @@
1
- gradio
2
- pandas
3
- plotly
4
- requests
 
 
 
 
 
1
+ # gradio==6.14.0 matches the HF Space sdk_version declared in README.md
2
+ # pandas: 2.x is stable and compatible; cap below 3 until gradio explicitly supports it
3
+ # plotly: 5.x is the current stable series
4
+ # requests: 2.31+ for security patches; no upper cap needed
5
+ gradio==6.14.0
6
+ pandas>=2.0,<3
7
+ plotly>=5.20,<6
8
+ requests>=2.31