Skip to content

Commit

Permalink
Merge branch 'main' into fix/arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ssukriti authored Mar 8, 2024
2 parents e718d04 + 3ac941d commit 5a2097c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build/launch_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@
def txt_to_obj(txt):
base64_bytes = txt.encode("ascii")
message_bytes = base64.b64decode(base64_bytes)
obj = pickle.loads(message_bytes)
return obj
try:
# If the bytes represent JSON string
return json.loads(message_bytes)
except UnicodeDecodeError:
# Otherwise the bytes are a pickled python dictionary
return pickle.loads(message_bytes)


def get_highest_checkpoint(dir_path):
Expand Down

0 comments on commit 5a2097c

Please sign in to comment.