mgbam commited on
Commit
82e5439
·
verified ·
1 Parent(s): cbc6688

Upload app_space.py

Browse files
Files changed (1) hide show
  1. app_space.py +7 -0
app_space.py CHANGED
@@ -1,10 +1,17 @@
1
  import io
2
  import json
 
 
3
  from typing import Any, Dict, List
4
 
5
  import gradio as gr
6
  import matplotlib.pyplot as plt
7
 
 
 
 
 
 
8
  from app.ml.gating import gate_signal
9
  from app.ml.inference import infer_ecg, load_model
10
  from app.rules.engine import evaluate_ecg_rules
 
1
  import io
2
  import json
3
+ import os
4
+ import sys
5
  from typing import Any, Dict, List
6
 
7
  import gradio as gr
8
  import matplotlib.pyplot as plt
9
 
10
+ # Ensure local package is importable when running in Hugging Face Spaces
11
+ ROOT = os.path.dirname(os.path.abspath(__file__))
12
+ if ROOT not in sys.path:
13
+ sys.path.insert(0, ROOT)
14
+
15
  from app.ml.gating import gate_signal
16
  from app.ml.inference import infer_ecg, load_model
17
  from app.rules.engine import evaluate_ecg_rules