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

Self chat with two different models #2803

Merged
merged 2 commits into from
Jul 27, 2020
Merged

Self chat with two different models #2803

merged 2 commits into from
Jul 27, 2020

Conversation

dianaglzrico
Copy link
Contributor

Patch description
Allow self chat to be performed between two different models.

Testing steps
To self chat with two different models, add partner like so:

python parlai/scripts/self_chat.py -mf zoo:pretrained_transformers/model_poly/model -p zoo:blender/blender_90M/model

Self chat with same model, remains the same:

python parlai/scripts/self_chat.py -mf zoo:blender/blender_90M/model

Logs

$ py parlai/scripts/self_chat.py  -mf zoo:pretrained_transformers/model_poly/model -p zoo:blender/blender_90M/model
...
[context]: Hi!
14:09:55 WARN | [ Executing eval mode with a common set of fixed candidates (n = 131438). ]
[Polyencoder]: hey
   [TransformerGenerator]: hello , how are you today ? i just got back from a long day at work , so i ' m nervous .
[Polyencoder]: ahhh i remember those days , i am good though , stressing over work though
   [TransformerGenerator]: that ' s good to hear . do you have any other hobbies you like to do ?
[Polyencoder]: not really besides animals and exercising when i can ! you ?
   [TransformerGenerator]: i like to play video games and watch netflix . what kind of animals do you exercise ?
[Polyencoder]: all animals ! i love animals . do you have any hobbies ?
   [TransformerGenerator]: yes , i love playing video games . i also like to read . what ' s your favorite book ?
[Polyencoder]: that is a hard question . i would have to say the bible
   [TransformerGenerator]: i love the bible as well . it ' s a great book . what do you do for fun ?
-- end of episode --
$ py parlai/scripts/self_chat.py  -mf zoo:blender/blender_90M/model
...
[context]: Hi!
[TransformerGenerator_1]: hello , how are you today ? i just got back from a long day at work , so i ' m nervous .
   [TransformerGenerator_2]: i am nervous as well . what do you do for work ? i hope you have a good day !
[TransformerGenerator_1]: thank you ! i work at a bank . i hope your day goes as well as mine too !
   [TransformerGenerator_2]: thank you so much ! i hope it goes well for you too . i am sure you will have a great day !
[TransformerGenerator_1]: thank you , i ' ll try my best to make it go as smoothly as possible . do you have any hobbies ?
   [TransformerGenerator_2]: i like to play video games and watch netflix . i also like to read . what about you ?
[TransformerGenerator_1]: i love video games as well ! i ' ve been playing a lot of call of duty lately .
   [TransformerGenerator_2]: i haven ' t played that one , but i have heard good things about it . what is your favorite game ?
[TransformerGenerator_1]: my favorite game is black ops 3 . i have been playing it since it came out in 2013 .
   [TransformerGenerator_2]: that ' s a long time ago ! i have never played it . i will have to check it out .
-- end of episode --

Copy link
Contributor

@emilydinan emilydinan left a comment

Choose a reason for hiding this comment

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

nice job diana! one thing that I think is missing here is the ability to pass opts to the partner model if they differ from the primary model. one solution is to pass opt via a file. what do you think of this @stephenroller

parlai/scripts/self_chat.py Outdated Show resolved Hide resolved
Copy link
Contributor

@emilydinan emilydinan left a comment

Choose a reason for hiding this comment

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

great job diana! i have a few small requested changes below and then this will be ready to merge! 😄

parlai/scripts/self_chat.py Show resolved Hide resolved
parlai/scripts/self_chat.py Outdated Show resolved Hide resolved
Copy link
Contributor

@emilydinan emilydinan left a comment

Choose a reason for hiding this comment

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

just realized something and updated my comments

parlai/scripts/self_chat.py Outdated Show resolved Hide resolved
@github-actions
Copy link

Your PR contains a change to a task. Please paste the results of the following command into a comment:

python tests/datatests/test_new_tasks.py

@dianaglzrico dianaglzrico requested a review from emilydinan July 15, 2020 00:46
Copy link
Contributor

@emilydinan emilydinan left a comment

Choose a reason for hiding this comment

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

just a couple really tiny changes and then we're there!

parlai/scripts/self_chat.py Outdated Show resolved Hide resolved
parlai/scripts/self_chat.py Show resolved Hide resolved
parlai/scripts/self_chat.py Outdated Show resolved Hide resolved
parlai/scripts/self_chat.py Outdated Show resolved Hide resolved
@dianaglzrico dianaglzrico requested a review from emilydinan July 27, 2020 14:54
Copy link
Contributor

@emilydinan emilydinan left a comment

Choose a reason for hiding this comment

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

thank you for persisting through all of these iterations! looks great ⭐

@dianaglzrico dianaglzrico merged commit 4edd7f2 into master Jul 27, 2020
@dianaglzrico dianaglzrico deleted the selfchat-2models branch July 27, 2020 16:51
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.

4 participants