pryvx 2.4.7__tar.gz → 2.4.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pryvx
3
- Version: 2.4.7
3
+ Version: 2.4.9
4
4
  Summary: A comprehensive package for privacy-enhancing technologies
5
5
  Home-page: UNKNOWN
6
6
  Author: PryvX (Jayesh Kenaudekar)
@@ -34,5 +34,7 @@ def send_params(serialized_model, connection_url, client_id):
34
34
 
35
35
  response = stub.SendModelParams(model_params, metadata=metadata)
36
36
 
37
+ print(f"✅ Model Params sent to server from {client_id}")
38
+
37
39
  return f"✅ Model Params sent to server from {client_id}"
38
40
 
@@ -4,10 +4,18 @@ from pryvx import pryvx_pb2_grpc
4
4
  import pickle
5
5
  from concurrent import futures
6
6
  import os
7
+ import shutil
7
8
 
8
9
  # Directory to store received models
9
10
  MODEL_SAVE_PATH = "received_models/"
10
- os.makedirs(MODEL_SAVE_PATH, exist_ok=True)
11
+
12
+ def prepare_model_folder():
13
+ # Delete the folder if it exists
14
+ if os.path.exists(MODEL_SAVE_PATH):
15
+ shutil.rmtree(MODEL_SAVE_PATH)
16
+ # Create a new folder
17
+ os.makedirs(MODEL_SAVE_PATH, exist_ok=True)
18
+
11
19
 
12
20
  class ModelServicer(pryvx_pb2_grpc.ModelServiceServicer):
13
21
  def __init__(self):
@@ -40,8 +48,11 @@ class ModelServicer(pryvx_pb2_grpc.ModelServiceServicer):
40
48
 
41
49
 
42
50
  def start_server():
51
+ prepare_model_folder()
52
+
43
53
  server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
44
54
  pryvx_pb2_grpc.add_ModelServiceServicer_to_server(ModelServicer(), server)
55
+
45
56
  server.add_insecure_port('[::]:50051')
46
57
  server.start()
47
58
  print("Server started. Listening on localhost:50051")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pryvx
3
- Version: 2.4.7
3
+ Version: 2.4.9
4
4
  Summary: A comprehensive package for privacy-enhancing technologies
5
5
  Home-page: UNKNOWN
6
6
  Author: PryvX (Jayesh Kenaudekar)
@@ -1,6 +1,6 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
- VERSION = '2.4.7'
3
+ VERSION = '2.4.9'
4
4
 
5
5
 
6
6
  # Setting up
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes