prevent log user message returning a tuple

#33
Files changed (1) hide show
  1. Gradio_UI.py +6 -8
Gradio_UI.py CHANGED
@@ -249,15 +249,13 @@ class GradioUI:
249
  return gr.Textbox(f"File uploaded: {file_path}", visible=True), file_uploads_log + [file_path]
250
 
251
  def log_user_message(self, text_input, file_uploads_log):
252
- return (
253
- text_input
254
- + (
255
- f"\nYou have been provided with these files, which might be helpful or not: {file_uploads_log}"
256
- if len(file_uploads_log) > 0
257
- else ""
258
- ),
259
- "",
260
  )
 
 
261
 
262
  def launch(self, **kwargs):
263
  import gradio as gr
 
249
  return gr.Textbox(f"File uploaded: {file_path}", visible=True), file_uploads_log + [file_path]
250
 
251
  def log_user_message(self, text_input, file_uploads_log):
252
+ message = text_input + (
253
+ f"\nYou have been provided with these files, which might be helpful or not: {file_uploads_log}"
254
+ if len(file_uploads_log) > 0
255
+ else ""
 
 
 
 
256
  )
257
+ return message, None
258
+ # Return just the message string, second value can be None (or anything other than the list you were appending to) since it's being passed to stored_messages
259
 
260
  def launch(self, **kwargs):
261
  import gradio as gr