#!/bin/bash # Quick fix script for OOM retry compilation errors set -e echo "🔧 Fixing OOM retry compilation errors..." # Fix 1: Remove the problematic data loader recreation code echo "📝 Fix 1: Removing data loader recreation attempt..." sed -i '797,811d' ml/src/trainers/tft.rs # Fix 2: Fix the infinite recursion in get_device() for TemporalFusionTransformer echo "📝 Fix 2: Fixing get_device() infinite recursion..." sed -i '85s/self.get_device()/\&self.device/' ml/src/trainers/tft.rs # Fix 3: Fix the private field access for QAT model echo "📝 Fix 3: Need to check if device field is public in TFT model..." echo "⚠️ Manual fix may be required if device field is private" echo "" echo "✅ Automated fixes applied!" echo "" echo "📋 Remaining manual steps:" echo "1. Check if 'device' field in TemporalFusionTransformer is public" echo "2. If not, make it public: 'pub device: Device'" echo "3. Run: cargo check -p ml --lib" echo "4. Run: cargo test -p ml" echo "" echo "📁 Fix details documented in: AGENT_36_TFT_OOM_RETRY_FIX.md"