Ultron28 commited on
Commit
58e4b7c
·
verified ·
1 Parent(s): 2094dfc

⚡ ULTRON: Sync colab_runner.sh

Browse files
Files changed (1) hide show
  1. colab_runner.sh +61 -0
colab_runner.sh ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # ==============================================================================
3
+ # ⚡ ULTRON Systems // Turnkey Colab CLI Deployment Runner
4
+ # Automates environment setup, Google Drive mounting, dependencies, and execution
5
+ # ==============================================================================
6
+
7
+ set -e
8
+
9
+ echo "=================================================================="
10
+ echo "⚡ ULTRON // CONVOLUTIONAL TRANSFORMER COLAB CLI RUNNER"
11
+ echo "=================================================================="
12
+
13
+ # 1. Detect GPU telemetry
14
+ if command -v nvidia-smi &> /dev/null; then
15
+ echo "⚡ [ULTRON] NVIDIA GPU Detected:"
16
+ nvidia-smi --query-gpu=name,memory.total,driver_version --format=csv,noheader
17
+ else
18
+ echo "⚠️ [ULTRON] No CUDA GPU detected! Running on CPU mode."
19
+ fi
20
+
21
+ # 2. Install optimized dependencies (pyarrow, fastparquet, huggingface_hub)
22
+ echo "⚡ [ULTRON] Verifying and installing essential runtime dependencies..."
23
+ pip install -q --upgrade pip
24
+ pip install -q pyarrow fastparquet huggingface_hub pandas numpy torch torchvision torchaudio
25
+
26
+ # 3. Mount Google Drive for persistent checkpoints (if running inside Google Colab)
27
+ python3 -c "
28
+ try:
29
+ from google.colab import drive
30
+ print('⚡ [ULTRON] Mounting Google Drive to /content/drive ...')
31
+ drive.mount('/content/drive', force_remount=False)
32
+ print('✅ [ULTRON] Google Drive mounted successfully.')
33
+ except ImportError:
34
+ print('⚡ [ULTRON] Non-Colab environment detected. Skipping Drive mount.')
35
+ "
36
+
37
+ # 4. Create persistent checkpoint directories
38
+ mkdir -p /content/drive/MyDrive/ohlcv_checkpoints 2>/dev/null || mkdir -p ./checkpoints
39
+ mkdir -p /tmp/ohlcv_cache
40
+
41
+ # 5. Prevent Colab Disconnect / Idle Keepalive (background task)
42
+ python3 -c "
43
+ import threading, time
44
+ def keepalive():
45
+ while True:
46
+ time.sleep(300)
47
+ # Touch a keepalive heartbeat
48
+ with open('/tmp/ultron_heartbeat.log', 'a') as f:
49
+ f.write(f'Keepalive heartbeat at {time.ctime()}\n')
50
+ threading.Thread(target=keepalive, daemon=True).start()
51
+ " &
52
+
53
+ # 6. Launch Training Loop
54
+ echo "⚡ [ULTRON] Launching autonomous training loop..."
55
+ python3 train.py \
56
+ --start_year 2021 \
57
+ --end_year 2025 \
58
+ --batch_size 64 \
59
+ --grad_accum 4 \
60
+ --lr 0.0003 \
61
+ --epochs 5