-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Allow more subclassing of self-chat world #3955
Conversation
parlai/tasks/self_chat/worlds.py
Outdated
for a in agents: | ||
a.reset() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should wrap this into self.reset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created a World.reset_agents()
method - is this what you were thinking? We can't call World.reset()
directly here, because there's additional logic there - i.e. World.reset()
also resets self.total_parleys
, self.total_exs
, self.time
, etc.
parlai/tasks/self_chat/worlds.py
Outdated
@@ -160,7 +154,7 @@ def parley(self): | |||
self.agents[i].observe(validate(context)) | |||
# clear contexts so they are only added once per episode | |||
self.contexts = None | |||
elif self.seed_utterances: | |||
elif self.seed_utterances and self._use_seed_utterances(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a slight preference toward integrating this logic closer with the above:
self.seed_utterances = self._get_seed_utt_acts(
self.episode_cnt, self.agents
)
Maybe by putting the self._use_seed_utterances
check inside of self._get_seed_utt_acts
so there's a single source of truth (if self.seed_utterances
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point - changed
Thanks @stephenroller @spencerp for useful comments! I've tried to address your suggestions as best as possible, and since you've both approved the PR, I'm merging it in now - but if you feel like I didn't address your suggestions appropriately, lemme know and I'd be happy to make changes in another PR |
Allow for more subclassing of
SelfChatWorld
to modify/extend its logic: