An error while using conversational pipeline

Code

from transformers import pipeline, Conversation

converse = pipeline("conversational", model="microsoft/DialoGPT-medium")
conversation = Conversation()

def answer_user(conversation, user_input):
    try:
        conversation.add_user_input(user_input)
        answer = converse([conversation])
        conversation.mark_processed()
        conversation.append_response(answer)
        print(f"Bot: {answer}")
    except Exception as e:
        print(f"Error {e}")


while True:
    user_input = input("User: ")
    answer_user(conversation, user_input)

From the second conversation, the following error shows.
Error maximum recursion depth exceeded while calling a Python object

I read this link(Pipelines), but can’t understand all things. Can I get some help?