demo 1
Browse files
app.py
CHANGED
@@ -3,10 +3,19 @@ import gradio as gr
|
|
3 |
import platform
|
4 |
import os;
|
5 |
import socket;
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
def sysinfo():
|
|
|
|
|
8 |
return f"""
|
9 |
hostname: {platform.node()} {socket.gethostname()}
|
|
|
|
|
10 |
""";
|
11 |
|
12 |
@spaces.GPU
|
|
|
3 |
import platform
|
4 |
import os;
|
5 |
import socket;
|
6 |
+
import torch
|
7 |
+
|
8 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
9 |
+
|
10 |
+
RandomTensor = torch.randn(1, 2) # Example audio tensor
|
11 |
|
12 |
def sysinfo():
|
13 |
+
tensorExample = RandomTensor.to(device)
|
14 |
+
|
15 |
return f"""
|
16 |
hostname: {platform.node()} {socket.gethostname()}
|
17 |
+
device: {device}
|
18 |
+
tensor: {tensorExample}
|
19 |
""";
|
20 |
|
21 |
@spaces.GPU
|