Spaces:
Build error
Build error
Delete app.py
Browse files
app.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import spaces
|
| 3 |
-
import torch
|
| 4 |
-
import os
|
| 5 |
-
|
| 6 |
-
zero = torch.Tensor([0]).cuda()
|
| 7 |
-
print(zero.device) # <-- 'cpu' 🤔
|
| 8 |
-
|
| 9 |
-
@spaces.GPU
|
| 10 |
-
def greet(n):
|
| 11 |
-
os.system("nvidia-smi")
|
| 12 |
-
print(zero.device) # <-- 'cuda:0' 🤗
|
| 13 |
-
return f"Hello {zero + n} Tensor"
|
| 14 |
-
|
| 15 |
-
demo = gr.Interface(fn=greet, inputs=gr.Number(), outputs=gr.Text())
|
| 16 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|