Spaces:
Sleeping
Sleeping
File size: 616 Bytes
c83b762 47aaf42 c83b762 5897cda 47aaf42 5897cda 47aaf42 c83b762 47aaf42 ca41d81 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import subprocess
import torch
import streamlit as st
import streamlit_ace
if torch.cuda.is_available():
for i in range(torch.cuda.device_count()):
st.text(torch.cuda.get_device_properties(i).name)
else:
st.text("Could not get device properties")
input_user = ""
with st.form("input code"):
code: str = streamlit_ace.st_ace(auto_update=True)
if st.form_submit_button("run code"):
prossess = subprocess.run(
code.rstrip().split(), shell=True, capture_output=True
)
st.text(prossess.stdout.decode("utf-8"))
st.error(prossess.stderr.decode("utf-8"))
|