Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -54,28 +54,17 @@ model = GPT2LMHeadModel.from_pretrained(model_name)
|
|
54 |
|
55 |
|
56 |
|
57 |
-
# Set the title of the web app
|
58 |
-
st.title("Simple Chatbot")
|
59 |
|
60 |
-
|
61 |
-
if 'chat_history' not in st.session_state:
|
62 |
-
st.session_state.chat_history = []
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
if user_input:
|
69 |
-
# Generate a response based on the user input
|
70 |
-
response = generate_response(user_input)
|
71 |
|
72 |
-
#
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
# Display chat history
|
77 |
-
for author, text in st.session_state.chat_history:
|
78 |
-
st.chat_message(text=text, author=author)
|
79 |
|
80 |
|
81 |
|
|
|
54 |
|
55 |
|
56 |
|
|
|
|
|
57 |
|
58 |
+
prompt = st.text_input("Say Something!", key=None, max_chars=None, disabled=False)
|
|
|
|
|
59 |
|
60 |
+
if prompt:
|
61 |
+
with st.container():
|
62 |
+
# Displaying the user's input question.
|
63 |
+
st.markdown(prompt)
|
|
|
|
|
|
|
64 |
|
65 |
+
# Generating and displaying the response.
|
66 |
+
response = generate_response(prompt)
|
67 |
+
st.markdown(generate_response(prompt))
|
|
|
|
|
|
|
|
|
68 |
|
69 |
|
70 |
|