Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@

# Initialize the Flask Web App
app = Flask(__name__)
CORS(app) # Allows front-end to talk to back-end easily
# Initialize WebSockets for real-time dashboard updates
socketio = SocketIO(app, cors_allowed_origins="*")
# Restrict CORS to trusted origins
CORS(app, origins=["http://127.0.0.1:5000", "http://localhost:5000"])
# Initialize WebSockets with restricted origins for real-time dashboard updates
socketio = SocketIO(app, cors_allowed_origins=["http://127.0.0.1:5000", "http://localhost:5000"])
# Detect if we have a GPU available
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"

Expand Down