Skip to content

Commit

Permalink
Fix OpenAI API with new param (show_after), closes #6747 (#6749)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: oobabooga <[email protected]>
  • Loading branch information
kelvie and oobabooga committed Feb 18, 2025
1 parent 7c883ef commit 769eee1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def generate_chat_reply(text, state, regenerate=False, _continue=False, loading_
yield history
return

show_after = html.escape(state["show_after"]) if state["show_after"] else None
show_after = html.escape(state.get("show_after")) if state.get("show_after") else None
for history in chatbot_wrapper(text, state, regenerate=regenerate, _continue=_continue, loading_message=loading_message, for_ui=for_ui):
if show_after:
after = history["visible"][-1][1].partition(show_after)[2] or "*Is thinking...*"
Expand Down

0 comments on commit 769eee1

Please sign in to comment.