Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,37 @@
|
|
1 |
from libretranslate.app import create_app
|
2 |
from libretranslate.default_values import DEFAULT_ARGUMENTS as DEFARGS
|
3 |
from waitress import serve
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
def create_args():
|
6 |
"""Return default arguments compatible with Hugging Face Spaces."""
|
|
|
1 |
from libretranslate.app import create_app
|
2 |
from libretranslate.default_values import DEFAULT_ARGUMENTS as DEFARGS
|
3 |
from waitress import serve
|
4 |
+
import os
|
5 |
+
print(os.cpu_count()) # Number of CPU cores
|
6 |
+
print(os.uname())
|
7 |
+
print(os.environ)
|
8 |
+
import platform
|
9 |
+
import psutil
|
10 |
+
|
11 |
+
print("Processor:", platform.processor())
|
12 |
+
print("CPU Cores:", psutil.cpu_count(logical=False)) # Physical cores
|
13 |
+
print("Logical CPUs:", psutil.cpu_count(logical=True)) # Logical cores
|
14 |
+
print("CPU Frequency:", psutil.cpu_freq().max, "MHz")
|
15 |
+
|
16 |
+
ram = psutil.virtual_memory()
|
17 |
+
print("Total RAM:", round(ram.total / (1024**3), 2), "GB")
|
18 |
+
print("Available RAM:", round(ram.available / (1024**3), 2), "GB")
|
19 |
+
print("Used RAM:", round(ram.used / (1024**3), 2), "GB")
|
20 |
+
print("RAM Usage Percentage:", ram.percent, "%")
|
21 |
+
|
22 |
+
disk = psutil.disk_usage('/')
|
23 |
+
print("Total Disk Space:", round(disk.total / (1024**3), 2), "GB")
|
24 |
+
print("Used Disk Space:", round(disk.used / (1024**3), 2), "GB")
|
25 |
+
print("Free Disk Space:", round(disk.free / (1024**3), 2), "GB")
|
26 |
+
print("Disk Usage Percentage:", disk.percent, "%")
|
27 |
+
|
28 |
+
|
29 |
+
print("System:", platform.system())
|
30 |
+
print("Node Name:", platform.node())
|
31 |
+
print("Release:", platform.release())
|
32 |
+
print("Version:", platform.version())
|
33 |
+
print("Machine:", platform.machine())
|
34 |
+
print("Architecture:", platform.architecture())
|
35 |
|
36 |
def create_args():
|
37 |
"""Return default arguments compatible with Hugging Face Spaces."""
|