avreymi commited on
Commit
5897cda
·
1 Parent(s): ca41d81

ask if cuda is avilable

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -3,10 +3,10 @@ import torch
3
  import streamlit as st
4
  import streamlit_ace
5
 
6
- try:
7
  for i in range(torch.cuda.device_count()):
8
  st.text(torch.cuda.get_device_properties(i).name)
9
- except:
10
  st.text("Could not get device properties")
11
  input_user = ""
12
  with st.form("input code"):
 
3
  import streamlit as st
4
  import streamlit_ace
5
 
6
+ if torch.cuda.is_available():
7
  for i in range(torch.cuda.device_count()):
8
  st.text(torch.cuda.get_device_properties(i).name)
9
+ else:
10
  st.text("Could not get device properties")
11
  input_user = ""
12
  with st.form("input code"):