mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 05:26:36 +00:00
c20018745b
- Introduced `ApiClient` for handling API interactions, including file uploads and downloads. - Implemented `CDNManager` for managing CDN operations with AWS S3. - Added `Augmentator` class for image augmentation, including bounding box corrections and transformations. - Created utility functions for annotation conversion and dataset visualization. - Established a new rules file for sound notifications during human input requests. These additions enhance the system's capabilities for data handling and user interaction, laying the groundwork for future features. Simplify autopilot state file to minimal current-step pointer; add execution safety rule to cursor-meta; remove Completed Steps/Key Decisions/Retry Log/Blockers from state template and all references.
36 lines
1.5 KiB
Python
36 lines
1.5 KiB
Python
import os
|
|
import subprocess
|
|
|
|
|
|
def get_hardware_info():
|
|
if os.name == 'nt': # windows
|
|
os_command = (
|
|
"powershell -Command \""
|
|
"Get-CimInstance -ClassName Win32_Processor | Select-Object -ExpandProperty Name | Write-Output; "
|
|
"Get-CimInstance -ClassName Win32_VideoController | Select-Object -ExpandProperty Name | Write-Output; "
|
|
"Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object -ExpandProperty TotalVisibleMemorySize | Write-Output; "
|
|
"(Get-Disk | Where-Object {$_.IsSystem -eq $true}).SerialNumber"
|
|
"\""
|
|
)
|
|
else:
|
|
os_command = (
|
|
"lscpu | grep 'Model name:' | cut -d':' -f2 && "
|
|
"lspci | grep VGA | cut -d':' -f3 && "
|
|
"free -k | awk '/^Mem:/ {print $2}' && "
|
|
"cat /sys/block/sda/device/vpd_pg80 2>/dev/null || cat /sys/block/sda/device/serial 2>/dev/null"
|
|
)
|
|
|
|
result = subprocess.check_output(os_command, shell=True).decode('utf-8', errors='ignore')
|
|
lines = [line.replace(" ", " ").replace("Name=", "").strip('\x00\x14 \t\n\r\v\f') for line in result.splitlines() if line.strip()]
|
|
|
|
cpu = lines[0]
|
|
gpu = lines[1]
|
|
|
|
# could be multiple gpus, that's why take memory and drive from the 2 last lines
|
|
len_lines = len(lines)
|
|
memory = lines[len_lines - 2].replace("TotalVisibleMemorySize=", "")
|
|
drive_serial = lines[len_lines - 1]
|
|
|
|
res = f'CPU: {cpu}. GPU: {gpu}. Memory: {memory}. DriveSerial: {drive_serial}'
|
|
return res
|