mali08890 commited on
Commit
60a55cc
·
verified ·
1 Parent(s): 33be09b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -13
app.py CHANGED
@@ -1,4 +1,4 @@
1
- import gradio as gr
2
  from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, pipeline
3
 
4
  # Load a lightweight, CPU-friendly model
@@ -77,7 +77,6 @@ with gr.Blocks(title="Cinco Returns Chatbot") as demo:
77
  gr.Markdown("""
78
  # 🧾 Cinco Returns Chatbot
79
  Welcome to the Cinco Returns Assistant. Ask your questions about returns, refunds, and exchanges.
80
-
81
  ### 💬 Example Questions:
82
  - *Can I return a sweater I no longer want?*
83
  - *What if I don’t have a receipt?*
@@ -98,17 +97,16 @@ with gr.Blocks(title="Cinco Returns Chatbot") as demo:
98
 
99
  state = gr.State([])
100
 
101
- submit_btn.click(
102
- fn=chat_fn,
103
- inputs=[user_input, state],
104
- outputs=[user_input, state, chatbot_ui] # return history to both state and Chatbot
105
- )
106
- user_input.submit(
107
- fn=chat_fn,
108
- inputs=[user_input, state],
109
- outputs=[user_input, state, chatbot_ui]
110
- )
111
-
112
 
113
  gr.Markdown("""
114
  ---
 
1
+ mport gradio as gr
2
  from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, pipeline
3
 
4
  # Load a lightweight, CPU-friendly model
 
77
  gr.Markdown("""
78
  # 🧾 Cinco Returns Chatbot
79
  Welcome to the Cinco Returns Assistant. Ask your questions about returns, refunds, and exchanges.
 
80
  ### 💬 Example Questions:
81
  - *Can I return a sweater I no longer want?*
82
  - *What if I don’t have a receipt?*
 
97
 
98
  state = gr.State([])
99
 
100
+ submit_btn.click(
101
+ fn=chat_fn,
102
+ inputs=[user_input, state],
103
+ outputs=[user_input, state, chatbot_ui] # return updated chat history to both state and UI
104
+ )
105
+ user_input.submit(
106
+ fn=chat_fn,
107
+ inputs=[user_input, state],
108
+ outputs=[user_input, state, chatbot_ui]
109
+ )
 
110
 
111
  gr.Markdown("""
112
  ---