Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
don't crash if a value can't be serialized (#3591)
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerp authored Apr 15, 2021
1 parent 5740a39 commit 2f48dcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parlai/utils/conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def save_conversations(
convo['context'].append(turn)
if new_pair:
convo['dialog'].append(new_pair)
json_convo = json.dumps(convo)
json_convo = json.dumps(convo, default=lambda v: '<not serializable>')
f.write(json_convo + '\n')
logging.info(f'Conversations saved to file: {to_save}')

Expand Down

0 comments on commit 2f48dcd

Please sign in to comment.