Pranjal Gupta commited on
Commit
c4f2134
·
1 Parent(s): 7bd0b80

gradio text box xhange

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -201,8 +201,10 @@ with gr.Blocks(title="Contextual RAG Chatbot on Hugging Face Spaces") as demo:
201
  # Submit handler to process user input and update the chatbot
202
  def respond(message, chat_history, hf_token_from_textbox):
203
  # The wrapper function now correctly receives the token from the text box
 
 
204
  response = gradio_rag_wrapper(message, chat_history, hf_token_from_textbox)
205
- chat_history.append((message, response))
206
  return "", chat_history
207
 
208
  # Define the submit event to call the respond function
 
201
  # Submit handler to process user input and update the chatbot
202
  def respond(message, chat_history, hf_token_from_textbox):
203
  # The wrapper function now correctly receives the token from the text box
204
+ user_message_text = message.get("text") or "File uploaded."
205
+
206
  response = gradio_rag_wrapper(message, chat_history, hf_token_from_textbox)
207
+ chat_history.append((user_message_text, response))
208
  return "", chat_history
209
 
210
  # Define the submit event to call the respond function