Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,11 +18,11 @@ st.title("DialoGPT Chat")
|
|
18 |
# Initialize chat history
|
19 |
chat_history_ids = None
|
20 |
|
21 |
-
#
|
22 |
-
|
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("
|
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.")
|
|
|
|