INNER CODE UNIT · Python

api_gpu_data

psalias2006/gpu-hot · app.py:62

async def api_gpu_data():
    """REST API endpoint for GPU data"""
    if config.MODE == 'hub':
        return {"gpus": {}, "timestamp": "hub_mode"}
    
    if hasattr(monitor_or_hub, 'get_gpu_data'):
        return {"gpus": await monitor_or_hub.get_gpu_data(), "timestamp": "async"}
    
    return {"gpus": {}, "timestamp": "no_data"}


def compare_versions(current, latest):
    """Compare semantic versions. Returns True if latest > current"""
    try:
        current_parts = [int(x) for x in current.split('.')]
        latest_parts = [int(x) for x in latest.split('.')]
        
        # Pad to same length

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…