Skip to content

Commit 1d4b271

Browse files
Merge pull request #307 from macrocosm-os/fix/epistula
remove entries in the epistula body that were causing issues with Epi…
2 parents 605a1fe + f5542c9 commit 1d4b271

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

folding/store.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def update_gjp_job(self, job: "Job", gjp_address: str, keypair, job_id: str):
220220
"""
221221

222222
body = get_epistula_body(job=job)
223-
223+
224224
body_bytes = self.epistula.create_message_body(body)
225225
headers = self.epistula.generate_header(hotkey=keypair, body=body_bytes)
226226

folding/utils/epistula_utils.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@ def get_epistula_body(job: "Job") -> dict:
2828
body["update_interval"] = body.pop("update_interval").total_seconds()
2929
body["max_time_no_improvement"] = body.pop("max_time_no_improvement").total_seconds()
3030
body["best_loss_at"] = (
31-
body["best_loss_at"] if pd.notna(body["best_loss_at"]) else datetime.now(timezone.utc).isoformat()
31+
body["best_loss_at"] if pd.notna(body["best_loss_at"]) else datetime.now(timezone.utc)
3232
)
33-
body["event"] = json.dumps(body.pop("event"))
3433
body["best_hotkey"] = "" if body["best_hotkey"] is None else body["best_hotkey"]
35-
body["best_loss"] = 0 if body["best_loss"] == np.inf else body["best_loss"]
34+
body["best_loss"] = 0.0 if body["best_loss"] == np.inf else body["best_loss"]
35+
36+
body["best_cpt_links"] = json.dumps(body.pop("best_cpt_links")) if body["best_cpt_links"] else [""]
37+
body["epsilon"] = int(body.pop("epsilon"))
38+
body.pop("event")
39+
body.pop("job_id")
40+
body.pop("gro_hash")
41+
body.pop("commit_hash")
3642

3743
return body

0 commit comments

Comments
 (0)