Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions gradio/external_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,10 @@ def chat_fn(image, text):


def chatbot_preprocess(text, state):
if not state:
return text, [], []
return (
text,
state["conversation"]["generated_responses"],
state["conversation"]["past_user_inputs"],
)
if state:
convo = state["conversation"]
return text, convo["generated_responses"], convo["past_user_inputs"]
return text, [], []


def chatbot_postprocess(response):
Expand Down