maxspad commited on
Commit
078bc56
·
1 Parent(s): 7250862

fixed error if cuda not avail

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -6,9 +6,11 @@ from plotly import graph_objects as go
6
  from overview import NQDOverview
7
 
8
  import torch
9
- print(f"Is CUDA available: {torch.cuda.is_available()}")
10
- # True
11
- print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
 
 
12
 
13
  # Function to load and cache models
14
  @st.experimental_singleton(show_spinner=False)
 
6
  from overview import NQDOverview
7
 
8
  import torch
9
+
10
+ cuda_available = torch.cuda.is_available()
11
+ print(f"Is CUDA available: {cuda_available}")
12
+ if cuda_available:
13
+ print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
14
 
15
  # Function to load and cache models
16
  @st.experimental_singleton(show_spinner=False)