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

[BlenderBot2] clean up reply during interactive mode #4379

Merged
merged 7 commits into from
Mar 25, 2022
Merged

Conversation

jxmsML
Copy link
Contributor

@jxmsML jxmsML commented Feb 23, 2022

Patch description
Right now, during interactive mode, the '_POTENTIALLY_UNSAFE__' from blenderbot2 generation would go into blenderbot 2 history and possibly affects its subsequent generation. However the model is never trained on observing such specially tokens, only generating them.

After the change, we still keep the '_POTENTIALLY_UNSAFE__' in the reply text, and only remove that from the blenderbot2 history.

Testing steps

Other information

"""

if (
self.opt('clean_reply', False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it returns here and doesn't go to cleaning the text if clean_reply is True?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to ALWAYS clean the reply and I think it's the right thing to do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to ALWAYS clean the reply and I think it's the right thing to do?

@klshuster
Copy link
Contributor

could you maybe add some test cases to make sure that _clean_text works?

if self_message is not None:
last_reply = self_message['text']
clean_reply = self._clean_text(last_reply)
self.history.add_reply(clean_reply)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps we should just override the History class and do this logic there?

@stephenroller
Copy link
Contributor

Go ahead and merge main into this branch

@jxmsML jxmsML merged commit 1635cfd into main Mar 25, 2022
@jxmsML jxmsML deleted the clean_reply branch March 25, 2022 17:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants