Spaces:
Sleeping
Sleeping
wei.wang commited on
Commit ·
77d45ab
1
Parent(s): 3da9bad
update
Browse files- app.py +5 -4
- requirements.txt +0 -1
app.py
CHANGED
|
@@ -4,7 +4,6 @@ import psutil
|
|
| 4 |
import torch
|
| 5 |
import subprocess
|
| 6 |
import sys
|
| 7 |
-
import pkg_resources
|
| 8 |
|
| 9 |
def get_system_info():
|
| 10 |
os_info = platform.platform()
|
|
@@ -26,8 +25,10 @@ def get_system_info():
|
|
| 26 |
except:
|
| 27 |
gcc_version = "Not available"
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
| 31 |
|
| 32 |
return f"""
|
| 33 |
Operating System: {os_info}
|
|
@@ -40,7 +41,7 @@ def get_system_info():
|
|
| 40 |
GCC Version: {gcc_version}
|
| 41 |
|
| 42 |
Installed Python Packages:
|
| 43 |
-
{
|
| 44 |
"""
|
| 45 |
|
| 46 |
def greet(name):
|
|
|
|
| 4 |
import torch
|
| 5 |
import subprocess
|
| 6 |
import sys
|
|
|
|
| 7 |
|
| 8 |
def get_system_info():
|
| 9 |
os_info = platform.platform()
|
|
|
|
| 25 |
except:
|
| 26 |
gcc_version = "Not available"
|
| 27 |
|
| 28 |
+
try:
|
| 29 |
+
pip_list = subprocess.check_output([sys.executable, '-m', 'pip', 'list', '--format=freeze']).decode('utf-8')
|
| 30 |
+
except:
|
| 31 |
+
pip_list = "Unable to retrieve pip list"
|
| 32 |
|
| 33 |
return f"""
|
| 34 |
Operating System: {os_info}
|
|
|
|
| 41 |
GCC Version: {gcc_version}
|
| 42 |
|
| 43 |
Installed Python Packages:
|
| 44 |
+
{pip_list}
|
| 45 |
"""
|
| 46 |
|
| 47 |
def greet(name):
|
requirements.txt
CHANGED
|
@@ -1,3 +1,2 @@
|
|
| 1 |
psutil
|
| 2 |
torch
|
| 3 |
-
pkg_resources
|
|
|
|
| 1 |
psutil
|
| 2 |
torch
|
|
|