demo 1
Browse files
app.py
CHANGED
|
@@ -7,9 +7,10 @@ import torch
|
|
| 7 |
|
| 8 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
def sysinfo():
|
|
|
|
| 13 |
tensorExample = RandomTensor.to(device)
|
| 14 |
|
| 15 |
return f"""
|
|
@@ -20,12 +21,11 @@ def sysinfo():
|
|
| 20 |
|
| 21 |
@spaces.GPU
|
| 22 |
def gpu():
|
| 23 |
-
|
| 24 |
-
return sysinfo();
|
| 25 |
|
| 26 |
|
| 27 |
def nogpu():
|
| 28 |
-
|
| 29 |
return sysinfo();
|
| 30 |
|
| 31 |
|
|
|
|
| 7 |
|
| 8 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 9 |
|
| 10 |
+
|
| 11 |
|
| 12 |
def sysinfo():
|
| 13 |
+
RandomTensor = torch.randn(1, 2) # Example audio tensor
|
| 14 |
tensorExample = RandomTensor.to(device)
|
| 15 |
|
| 16 |
return f"""
|
|
|
|
| 21 |
|
| 22 |
@spaces.GPU
|
| 23 |
def gpu():
|
| 24 |
+
return sysinfo(RandomTensor);
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
def nogpu():
|
| 28 |
+
|
| 29 |
return sysinfo();
|
| 30 |
|
| 31 |
|