Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can Ping Pong principle be applied to let 2 LLM Chatbots talk to each other fully automatically? #81

Open
jbdatascience opened this issue Jun 9, 2023 · 4 comments

Comments

@jbdatascience
Copy link

I wonder: Can Ping Pong principle be applied to let 2 LLM Chatbots talk to each other fully automatically?

@deep-diver
Copy link
Owner

Yes

Just create single pinpongs (list)
Then share it with two different prompt objects

@jbdatascience
Copy link
Author

Yes

Just create single pinpongs (list) Then share it with two different prompt objects

Interesting!
Could you show a piece of Python could to do just that ?

@deep-diver
Copy link
Owner

for example, lets say you want to switch between different prompting styles of from Alapca and StableLM while underlying chats are shared

from pingpong.gradio import GradioAlpacaChatPPManager
from pingpong.gradio import GradioStableLMChatPPManager

pingpongs = []

alpaca = GradioAlpacaChatPPManager()
stablelm = GradioStableLMChatPPManager()

alpaca.ctx = "this is a context"
alpaca.pingpongs = pingpongs
stablelm.ctx = "this is a context"
stablelm.pingpongs = pingpongs

alpaca.add_ping("hello") # starting prompt

prompt_for_stablelm = stablelm.build_prompts()
stablelm.add_pong(generate(prompt_for_stablelm)) # generate is a function to generate text based on given prompt

prompt_for_alpaca = alpaca.build_prompts()
alpaca.add_pong(generate(prompt_for_alpaca))

...

@jbdatascience
Copy link
Author

Thank you. I will try this out and see where it takes me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants