homer-meng commited on
Commit
190d9e9
1 Parent(s): a0e846a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -1,13 +1,13 @@
1
- import torch
2
  import streamlit as st
3
- from diffusers import StableDiffusionPipeline
4
- from PIL import Image
5
 
6
- pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16)
7
- pipe = pipe.to("cuda")
8
 
9
- prompt = st.text_area("Enter a prompt: ")
10
- image = pipe(prompt).images[0]
11
 
12
- image = Image.fromarray(image)
13
- image.show()
 
 
 
 
 
1
  import streamlit as st
2
+ import torch
 
3
 
4
+ st.title("Hugging Face Space GPU Info")
 
5
 
6
+ # Check if GPU is available
7
+ gpu_available = torch.cuda.is_available()
8
 
9
+ if gpu_available:
10
+ gpu_name = torch.cuda.get_device_name(0)
11
+ st.write(f"GPU available: {gpu_name}")
12
+ else:
13
+ st.write("No GPU available")