Spaces:
Runtime error
Runtime error
Commit ·
8fa8335
1
Parent(s): 01c1ecc
Update server.py
Browse files
server.py
CHANGED
|
@@ -89,14 +89,14 @@ async def resolution(request : Request, background_tasks: BackgroundTasks, respo
|
|
| 89 |
def check_gpu_usage():
|
| 90 |
try:
|
| 91 |
output = subprocess.check_output("nvidia-smi", shell=True).decode("utf-8")
|
| 92 |
-
lines = output.split('\n')
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
print("GPU is not being used.")
|
| 99 |
-
return
|
| 100 |
except subprocess.CalledProcessError:
|
| 101 |
print("Nvidia-smi command not found, please check if the NVIDIA drivers are installed.")
|
| 102 |
return "Nvidia-smi command not found, please check if the NVIDIA drivers are installed."
|
|
|
|
| 89 |
def check_gpu_usage():
|
| 90 |
try:
|
| 91 |
output = subprocess.check_output("nvidia-smi", shell=True).decode("utf-8")
|
| 92 |
+
# lines = output.split('\n')
|
| 93 |
+
# usage=[]
|
| 94 |
+
# for line in lines:
|
| 95 |
+
# if '%' in line:
|
| 96 |
+
# usage.append(line.strip().split(' ')[-2])
|
| 97 |
+
#
|
| 98 |
+
# print("GPU is not being used.")
|
| 99 |
+
return output
|
| 100 |
except subprocess.CalledProcessError:
|
| 101 |
print("Nvidia-smi command not found, please check if the NVIDIA drivers are installed.")
|
| 102 |
return "Nvidia-smi command not found, please check if the NVIDIA drivers are installed."
|