awacke1's picture
Create app.py
ac4b0f8
raw
history blame contribute delete
459 Bytes
import streamlit as st
import torch
def detect_gpu():
if torch.cuda.is_available():
device = torch.cuda.get_device_name(0)
device_memory = torch.cuda.get_device_properties(0).total_memory
return f"GPU detected: {device}\nMemory: {device_memory} bytes"
else:
return "No GPU detected."
def main():
st.title("GPU Detection Demo")
result = detect_gpu()
st.write(result)
if __name__ == "__main__":
main()