oscarzhang commited on
Commit
5b10d1e
·
verified ·
1 Parent(s): 4cd9c73

Upload wearable_anomaly_detector.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. wearable_anomaly_detector.py +6 -1
wearable_anomaly_detector.py CHANGED
@@ -14,7 +14,12 @@ import pandas as pd
14
 
15
  # 添加项目根目录到路径
16
  import sys
17
- sys.path.insert(0, str(Path(__file__).parent.parent))
 
 
 
 
 
18
 
19
  from models.phased_lstm_tft import PhasedLSTM_TFT, PhasedLSTM_TFT_WithEnhancedAnomalyDetection
20
  from feature_calculator import FeatureCalculator
 
14
 
15
  # 添加项目根目录到路径
16
  import sys
17
+ BASE_DIR = Path(__file__).parent
18
+ PROJECT_ROOT = BASE_DIR.parent
19
+ for candidate in [BASE_DIR, PROJECT_ROOT]:
20
+ candidate_str = str(candidate)
21
+ if candidate_str not in sys.path:
22
+ sys.path.insert(0, candidate_str)
23
 
24
  from models.phased_lstm_tft import PhasedLSTM_TFT, PhasedLSTM_TFT_WithEnhancedAnomalyDetection
25
  from feature_calculator import FeatureCalculator