Spaces:
Runtime error
Runtime error
Download app.py from mapleadmin/GPT: direct link, hf CLI and curl.
- Browser
- Download file 412 Bytes
-
https://huggingface.co/spaces/mapleadmin/GPT/resolve/refs%2Fpr%2F1/app.py
- Command line
-
hf download hf://spaces/mapleadmin/GPT@refs/pr/1/app.py
-
curl -L -o app.py https://huggingface.co/spaces/mapleadmin/GPT/resolve/refs%2Fpr%2F1/app.py
412 Bytes
| import streamlit as st | |
| import torch | |
| # Check if GPU is available | |
| if torch.cuda.is_available(): | |
| # Use GPU for a simple task | |
| device = torch.device("cuda") | |
| a = torch.rand(1000, 1000).to(device) | |
| b = torch.rand(1000, 1000).to(device) | |
| c = torch.matmul(a, b) | |
| # Ensure GPU is utilized | |
| st.text("GPU Utilization should be non-zero during this task.") | |
| else: | |
| st.text("No GPU available.") | |