inference works
This commit is contained in:
52
test_model_registry.py
Normal file
52
test_model_registry.py
Normal file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env python3
|
||||
import logging
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Add the project root to the path
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
# Configure logging
|
||||
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def test_model_registry():
|
||||
"""Test the model registry state"""
|
||||
try:
|
||||
from core.orchestrator import TradingOrchestrator
|
||||
from core.data_provider import DataProvider
|
||||
|
||||
logger.info("Testing model registry...")
|
||||
|
||||
# Initialize data provider
|
||||
data_provider = DataProvider()
|
||||
|
||||
# Initialize orchestrator
|
||||
orchestrator = TradingOrchestrator(data_provider=data_provider)
|
||||
|
||||
# Check model registry state
|
||||
logger.info(f"Model registry models: {len(orchestrator.model_registry.models)}")
|
||||
logger.info(f"Registered models: {list(orchestrator.model_registry.models.keys())}")
|
||||
|
||||
# Check if models were created
|
||||
logger.info(f"RL Agent: {orchestrator.rl_agent is not None}")
|
||||
logger.info(f"CNN Model: {orchestrator.cnn_model is not None}")
|
||||
logger.info(f"CNN Adapter: {orchestrator.cnn_adapter is not None}")
|
||||
|
||||
# Check model weights
|
||||
logger.info(f"Model weights: {orchestrator.model_weights}")
|
||||
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error testing model registry: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
return False
|
||||
|
||||
if __name__ == "__main__":
|
||||
success = test_model_registry()
|
||||
if success:
|
||||
logger.info("✅ Model registry test completed successfully")
|
||||
else:
|
||||
logger.error("❌ Model registry test failed")
|
Reference in New Issue
Block a user