Spaces:
Sleeping
Sleeping
wei.wang commited on
Commit ·
3da9bad
1
Parent(s): 4d57181
update
Browse files- app.py +8 -2
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import psutil
|
|
| 4 |
import torch
|
| 5 |
import subprocess
|
| 6 |
import sys
|
|
|
|
| 7 |
|
| 8 |
def get_system_info():
|
| 9 |
os_info = platform.platform()
|
|
@@ -25,6 +26,9 @@ def get_system_info():
|
|
| 25 |
except:
|
| 26 |
gcc_version = "Not available"
|
| 27 |
|
|
|
|
|
|
|
|
|
|
| 28 |
return f"""
|
| 29 |
Operating System: {os_info}
|
| 30 |
CPU: {cpu_info}
|
|
@@ -34,12 +38,14 @@ def get_system_info():
|
|
| 34 |
NVIDIA Driver Version: {nvidia_driver}
|
| 35 |
Python Version: {python_version}
|
| 36 |
GCC Version: {gcc_version}
|
|
|
|
|
|
|
|
|
|
| 37 |
"""
|
| 38 |
|
| 39 |
def greet(name):
|
| 40 |
system_info = get_system_info()
|
| 41 |
return f"Hello {name}!!\n\nSystem Information:\n{system_info}"
|
| 42 |
|
| 43 |
-
print("weiw test")
|
| 44 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 45 |
-
demo.launch(
|
|
|
|
| 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 |
except:
|
| 27 |
gcc_version = "Not available"
|
| 28 |
|
| 29 |
+
installed_packages = [f"{pkg.key}=={pkg.version}" for pkg in pkg_resources.working_set]
|
| 30 |
+
packages_info = "\n".join(installed_packages)
|
| 31 |
+
|
| 32 |
return f"""
|
| 33 |
Operating System: {os_info}
|
| 34 |
CPU: {cpu_info}
|
|
|
|
| 38 |
NVIDIA Driver Version: {nvidia_driver}
|
| 39 |
Python Version: {python_version}
|
| 40 |
GCC Version: {gcc_version}
|
| 41 |
+
|
| 42 |
+
Installed Python Packages:
|
| 43 |
+
{packages_info}
|
| 44 |
"""
|
| 45 |
|
| 46 |
def greet(name):
|
| 47 |
system_info = get_system_info()
|
| 48 |
return f"Hello {name}!!\n\nSystem Information:\n{system_info}"
|
| 49 |
|
|
|
|
| 50 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 51 |
+
demo.launch()
|
requirements.txt
CHANGED
|
@@ -1,2 +1,3 @@
|
|
| 1 |
psutil
|
| 2 |
torch
|
|
|
|
|
|
| 1 |
psutil
|
| 2 |
torch
|
| 3 |
+
pkg_resources
|