File size: 827 Bytes
4384e91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import sys
import os

# Add the current directory to sys.path
sys.path.append(os.getcwd())

try:
    print("Testing imports...")
    import gradio as gr
    import torch
    import spaces
    import talib
    from core.data import load_data
    from core.train_eval import train_and_evaluate
    print("Imports successful!")

    print("Verifying Zero GPU decorator...")
    # Check if train_and_evaluate has the spaces decorator
    if hasattr(train_and_evaluate, "__wrapped__"):
        print("Zero GPU decorator detected on train_and_evaluate.")
    else:
        print("Warning: Zero GPU decorator NOT detected on train_and_evaluate.")

    print("Startup test passed!")
    sys.exit(0)
except Exception as e:
    print(f"Startup test failed with error: {e}")
    import traceback
    traceback.print_exc()
    sys.exit(1)