maxspad commited on
Commit
7250862
·
1 Parent(s): 8e11190

switching to CUDA if available

Browse files
Files changed (2) hide show
  1. app.py +5 -0
  2. requirements.txt +1 -0
app.py CHANGED
@@ -5,6 +5,11 @@ from plotly import graph_objects as go
5
 
6
  from overview import NQDOverview
7
 
 
 
 
 
 
8
  # Function to load and cache models
9
  @st.experimental_singleton(show_spinner=False)
10
  def load_model(username, prefix, model_name):
 
5
 
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)
15
  def load_model(username, prefix, model_name):
requirements.txt CHANGED
@@ -1,3 +1,4 @@
 
1
  torch
2
  torchvision
3
  torchaudio
 
1
+ --extra-index-url https://download.pytorch.org/whl/cu113
2
  torch
3
  torchvision
4
  torchaudio