(self, data_dict)
| 237 | ] |
| 238 | |
| 239 | def initialize(self, data_dict): |
| 240 | if data_dict is None: |
| 241 | self.exists = False |
| 242 | return |
| 243 | |
| 244 | self.exists = True |
| 245 | |
| 246 | pd_node_id = data_dict["node_id"] |
| 247 | self.node_id_high = (pd_node_id >> 64) & 0xFFFFFFFFFFFFFFFF |
| 248 | self.node_id_low = pd_node_id & 0xFFFFFFFFFFFFFFFF |
| 249 | |
| 250 | ip_parts = [int(part) for part in data_dict["ip"].split(".")] |
| 251 | self.ip = (ctypes.c_int32 * 4)(*ip_parts) |
| 252 | |
| 253 | self.rpyc_port = data_dict["rpyc_port"] |
| 254 | self.max_new_tokens = data_dict["max_new_tokens"] |
| 255 | |
| 256 | pd_master_node_id = data_dict["pd_master_node_id"] |
| 257 | self.pd_master_node_id_high = (pd_master_node_id >> 64) & 0xFFFFFFFFFFFFFFFF |
| 258 | self.pd_master_node_id_low = pd_master_node_id & 0xFFFFFFFFFFFFFFFF |
| 259 | |
| 260 | def to_dict(self): |
| 261 | if not self.exists: |
no outgoing calls