Aytaj commited on
Commit
04ce092
·
1 Parent(s): 168ff57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -18,11 +18,11 @@ st.title("DialoGPT Chat")
18
  # Initialize chat history
19
  chat_history_ids = None
20
 
21
- # Conversation loop
22
- while st.button("Restart Conversation"):
23
- # Get user input
24
- user_input = st.text_input("You:", "")
25
 
 
 
26
  if user_input:
27
  # Generate response
28
  chat_history_ids = generate_response(chat_history_ids, user_input)
@@ -31,6 +31,4 @@ while st.button("Restart Conversation"):
31
  st.text("DialoGPT: {}".format(tokenizer.decode(chat_history_ids[:, -1][0], skip_special_tokens=True)))
32
 
33
  # Inform the user that the conversation has ended
34
- st.text("Conversation Ended. Press the 'Restart Conversation' button to start a new conversation.")
35
-
36
-
 
18
  # Initialize chat history
19
  chat_history_ids = None
20
 
21
+ # User input text box
22
+ user_input = st.text_input("You:", "")
 
 
23
 
24
+ # Check if the user pressed Enter
25
+ if st.button("Send"):
26
  if user_input:
27
  # Generate response
28
  chat_history_ids = generate_response(chat_history_ids, user_input)
 
31
  st.text("DialoGPT: {}".format(tokenizer.decode(chat_history_ids[:, -1][0], skip_special_tokens=True)))
32
 
33
  # Inform the user that the conversation has ended
34
+ st.text("Press 'Send' to continue the conversation.")