I’m having this issue and cannot see why it’s happening. I have a fairly straightforward setup. It works fine on the first pass-through, when the history is empty. As soon as I try to submit my second prompt, it fails on the line that calls the ConversationalRetrievalChain (qa({"question": prompt, "chat_history": history})
, and gives me the following error:
ValueError: Unsupported chat history format: <class 'list'>. Full chat history: [[.....]]
Here’s my code:
with gr.Blocks() as demo:
chatbot = gr.Chatbot()
msg = gr.Textbox()
clear = gr.Button("Clear")
def user(prompt, history):
response = qa({"question": prompt, "chat_history": history})
history.append((prompt, response["answer"]))
return "", history
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False)
clear.click(lambda: None, None, chatbot, queue=False)
Any idea what could be happening? Thanks in advance.