From 040c3084f014b033fbe8e825845c49492f8b10ee Mon Sep 17 00:00:00 2001 From: Andrei Stoian <95410270+andrei-stoian-zama@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:15:51 +0200 Subject: [PATCH] fix: relax python version restrictions (#853) Co-authored-by: James Marsh --- .../ml/deployment/fhe_client_server.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/concrete/ml/deployment/fhe_client_server.py b/src/concrete/ml/deployment/fhe_client_server.py index 6d28541c3..b1f1199ad 100644 --- a/src/concrete/ml/deployment/fhe_client_server.py +++ b/src/concrete/ml/deployment/fhe_client_server.py @@ -64,6 +64,7 @@ def check_concrete_versions(zip_path: Path): """ with zipfile.ZipFile(zip_path) as zip_file: + is_mlir = "circuit.mlir" in zip_file.namelist() with zip_file.open("versions.json", mode="r") as file: versions = json.load(file) @@ -91,14 +92,15 @@ def check_concrete_versions(zip_path: Path): + "\n".join(f"{error[0]}: {error[1]} != {error[2]}" for error in errors) ) - # Raise an error if the Python version do not match the one currently installed - if not versions["python"].startswith( - f"{sys.version_info.major}.{sys.version_info.minor}" - ): # pragma: no cover - raise ValueError( - "Not the same Python version between the compiler and the server." - f"{versions['python']} != {sys.version_info.major}.{sys.version_info.minor}" - ) + if not is_mlir: + # Raise an error if the Python version do not match the one currently installed + if not versions["python"].startswith( + f"{sys.version_info.major}.{sys.version_info.minor}" + ): # pragma: no cover + raise ValueError( + "Not the same Python version between the compiler and the server." + f"{versions['python']} != {sys.version_info.major}.{sys.version_info.minor}" + ) class FHEModelServer: