From 65b8d6c0f1ccd139c00c71db93ad4dbff133e2ee Mon Sep 17 00:00:00 2001 From: sibianl Date: Mon, 10 Nov 2025 10:57:38 +0800 Subject: [PATCH 1/2] tmp --- README.md | 2 +- pyproject.toml | 1 - src/parallax/cli.py | 33 ++++----------------------------- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index bba7dcc..49e4ee2 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ To allow the API to be accessible from other machines, add the argument `--host parallax run --host 0.0.0.0 ``` -When running `parallax run` for the first time or after an update, some basic info (like version and gpu name) might be sent to help improve the project. To disable this, use the `-u` flag: +When running `parallax run` for the first time or after an update, the code version info might be sent to help improve the project. To disable this, use the `-u` flag: ```sh parallax run -u ``` diff --git a/pyproject.toml b/pyproject.toml index 4f9055c..70ac7e4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,6 @@ dependencies = [ "uvloop", "fastapi", "pydantic", - "py-machineid", "protobuf==6.31.1", "dijkstar==2.6.0", "lattica==1.0.9", diff --git a/src/parallax/cli.py b/src/parallax/cli.py index 0059d76..47c8620 100644 --- a/src/parallax/cli.py +++ b/src/parallax/cli.py @@ -14,11 +14,10 @@ import signal import subprocess import sys +from types import NoneType -import machineid import requests -from parallax.server.server_info import HardwareInfo from parallax_utils.file_util import get_project_root from parallax_utils.logging_config import get_logger from parallax_utils.version_check import get_current_version @@ -297,40 +296,16 @@ def chat_command(args, passthrough_args: list[str] | None = None): _execute_with_graceful_shutdown(cmd) -def collect_machine_info(): - """Collect machine information.""" - version = get_current_version() - device_uuid = str(machineid.id()) - try: - hw = HardwareInfo.detect() - return { - "uuid": device_uuid, - "version": version, - "gpu": hw.chip, - } - except Exception: - return { - "uuid": device_uuid, - "version": version, - "gpu": "unknown", - } - - def update_package_info(): """Update package information.""" - usage_info = collect_machine_info() + version = get_current_version() try: package_info = load_package_info() - if ( - package_info is not None - and package_info["uuid"] == usage_info["uuid"] - and package_info["version"] == usage_info["version"] - and package_info["gpu"] == usage_info["gpu"] - ): + if package_info is not NoneType and package_info["version"] == version: return - save_package_info(usage_info) + save_package_info({"version": version}) except Exception: pass From 8f2afb6d067e6a9cb8d942656fd995ad0d3ca2c2 Mon Sep 17 00:00:00 2001 From: sibianl Date: Mon, 10 Nov 2025 16:16:47 +0800 Subject: [PATCH 2/2] fix --- src/parallax/cli.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/parallax/cli.py b/src/parallax/cli.py index 47c8620..7b11760 100644 --- a/src/parallax/cli.py +++ b/src/parallax/cli.py @@ -14,7 +14,6 @@ import signal import subprocess import sys -from types import NoneType import requests @@ -302,7 +301,7 @@ def update_package_info(): try: package_info = load_package_info() - if package_info is not NoneType and package_info["version"] == version: + if package_info is not None and package_info["version"] == version: return save_package_info({"version": version})