shaneperry0101 commited on
Commit
6bd7f31
·
verified ·
1 Parent(s): 64dac4c

fix(test): find bug

Browse files
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -13,21 +13,21 @@ if 'conversation' not in st.session_state:
13
  st.title("Chatbot Application")
14
  user_input = st.text_input("You:", key="input")
15
 
16
- if st.button("Send"):
17
- if user_input:
18
- # Append user input to the conversation
19
- st.session_state.conversation.append({"role": "user", "content": user_input})
20
-
21
- # Generate response
22
- response = chatbot(user_input)
23
- bot_response = response[0]['generated_text']
24
-
25
- # Append bot response to the conversation
26
- st.session_state.conversation.append({"role": "bot", "content": bot_response})
27
-
28
- # Display the conversation
29
- for message in st.session_state.conversation:
30
- if message["role"] == "user":
31
- st.text_area("You:", value=message["content"], key=f"user_{message['content']}", height=50)
32
- else:
33
- st.text_area("Bot:", value=message["content"], key=f"bot_{message['content']}", height=50)
 
13
  st.title("Chatbot Application")
14
  user_input = st.text_input("You:", key="input")
15
 
16
+ # if st.button("Send"):
17
+ # if user_input:
18
+ # # Append user input to the conversation
19
+ # st.session_state.conversation.append({"role": "user", "content": user_input})
20
+
21
+ # # Generate response
22
+ # response = chatbot(user_input)
23
+ # bot_response = response[0]['generated_text']
24
+
25
+ # # Append bot response to the conversation
26
+ # st.session_state.conversation.append({"role": "bot", "content": bot_response})
27
+
28
+ # # Display the conversation
29
+ # for message in st.session_state.conversation:
30
+ # if message["role"] == "user":
31
+ # st.text_area("You:", value=message["content"], key=f"user_{message['content']}", height=50)
32
+ # else:
33
+ # st.text_area("Bot:", value=message["content"], key=f"bot_{message['content']}", height=50)