hsuwill000 commited on
Commit
0e6fea8
·
verified ·
1 Parent(s): 3c3f47e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -26,11 +26,12 @@ def respond(message):
26
  )
27
  reply = response[0]['generated_text'].strip()
28
 
29
- return reply
 
30
 
31
  except Exception as e:
32
  print(f"Error: {e}")
33
- return "Sorry, something went wrong. Please try again."
34
 
35
  # Set up Gradio chat interface
36
  with gr.Blocks() as demo:
@@ -43,4 +44,4 @@ with gr.Blocks() as demo:
43
  msg.submit(respond, msg, chatbot)
44
 
45
  if __name__ == "__main__":
46
- demo.launch()
 
26
  )
27
  reply = response[0]['generated_text'].strip()
28
 
29
+ # Return as a tuple (user message, bot reply)
30
+ return [(message, reply)]
31
 
32
  except Exception as e:
33
  print(f"Error: {e}")
34
+ return [(message, "Sorry, something went wrong. Please try again.")]
35
 
36
  # Set up Gradio chat interface
37
  with gr.Blocks() as demo:
 
44
  msg.submit(respond, msg, chatbot)
45
 
46
  if __name__ == "__main__":
47
+ demo.launch(share=True)