demo 1
Browse files
app.py
CHANGED
|
@@ -13,10 +13,13 @@ def sysinfo(device):
|
|
| 13 |
RandomTensor = torch.randn(1, 2) # Example audio tensor
|
| 14 |
tensorExample = RandomTensor.to(device)
|
| 15 |
|
|
|
|
|
|
|
| 16 |
return f"""
|
| 17 |
hostname: {platform.node()} {socket.gethostname()}
|
| 18 |
device: {device}
|
| 19 |
tensor: {tensorExample}
|
|
|
|
| 20 |
""";
|
| 21 |
|
| 22 |
@spaces.GPU
|
|
|
|
| 13 |
RandomTensor = torch.randn(1, 2) # Example audio tensor
|
| 14 |
tensorExample = RandomTensor.to(device)
|
| 15 |
|
| 16 |
+
tocpu = tensorExample.cpu().squeeze().half().tolist()
|
| 17 |
+
|
| 18 |
return f"""
|
| 19 |
hostname: {platform.node()} {socket.gethostname()}
|
| 20 |
device: {device}
|
| 21 |
tensor: {tensorExample}
|
| 22 |
+
toCpu: {tocpu}
|
| 23 |
""";
|
| 24 |
|
| 25 |
@spaces.GPU
|