Spaces:
Paused
Paused
Download predictive_maintenance/Colab_Training_Script.py from Gaurav711/SupportOps-Env: direct link, hf CLI and curl.
- Browser
- Download file 934 Bytes
-
https://huggingface.co/spaces/Gaurav711/SupportOps-Env/resolve/main/predictive_maintenance/Colab_Training_Script.py
- Command line
-
hf download hf://spaces/Gaurav711/SupportOps-Env/predictive_maintenance/Colab_Training_Script.py
-
curl -L -o Colab_Training_Script.py https://huggingface.co/spaces/Gaurav711/SupportOps-Env/resolve/main/predictive_maintenance/Colab_Training_Script.py
934 Bytes
| import os | |
| import sys | |
| import subprocess | |
| def run_pipeline(): | |
| print("Starting Predictive Maintenance Training Pipeline on Colab...") | |
| scripts = [ | |
| "download_data.py", | |
| "preprocess.py", | |
| "train_anomaly_detector.py", | |
| "train_rul_predictor.py", | |
| "train_battery_soh.py" | |
| ] | |
| base_dir = os.path.dirname(os.path.abspath(__file__)) | |
| for script in scripts: | |
| script_path = os.path.join(base_dir, script) | |
| print(f"\n{'='*50}\nRunning {script}...\n{'='*50}") | |
| result = subprocess.run([sys.executable, script_path], cwd=base_dir) | |
| if result.returncode != 0: | |
| print(f"Error running {script}. Pipeline halted.") | |
| sys.exit(1) | |
| print("\n" + "="*50) | |
| print("PIPELINE COMPLETE!") | |
| print("All models saved to models/") | |
| print("All plots saved to plots/") | |
| print("="*50) | |
| if __name__ == "__main__": | |
| run_pipeline() | |