Skip to content

Commit

Permalink
Fix for set_speaker_convo_info in DB mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jpwchang committed Nov 3, 2022
1 parent fcb405c commit 2e32bc1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions convokit/model/corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,11 +1344,11 @@ def set_speaker_convo_info(self, speaker_id, convo_id, key, value):
"""

speaker = self.get_speaker(speaker_id)
if "conversations" not in speaker.meta:
speaker.meta["conversations"] = {}
if convo_id not in speaker.meta["conversations"]:
speaker.meta["conversations"][convo_id] = {}
speaker.meta["conversations"][convo_id][key] = value
speaker_convos = speaker.meta.get("conversations", {})
if convo_id not in speaker_convos:
speaker_convos[convo_id] = {}
speaker_convos[convo_id][key] = value
speaker.meta["conversations"] = speaker_convos

def get_speaker_convo_info(self, speaker_id, convo_id, key=None):
"""
Expand Down

0 comments on commit 2e32bc1

Please sign in to comment.