Update app.py
Browse files
app.py
CHANGED
@@ -178,7 +178,6 @@ def main():
|
|
178 |
if "history" not in st.session_state:
|
179 |
st.session_state.history = []
|
180 |
st.title("Hello bot: ")
|
181 |
-
st.text_input("Talk to the bot", key="input_text", on_change=generate_answer)
|
182 |
def generate_answer():
|
183 |
tokenizer, model = get_models()
|
184 |
user_message = st.session_state.input_text
|
@@ -189,6 +188,7 @@ def main():
|
|
189 |
) # .replace("<s>", "").replace("</s>", "")
|
190 |
st.session_state.history.append({"message": user_message, "is_user": True})
|
191 |
st.session_state.history.append({"message": message_bot, "is_user": False})
|
|
|
192 |
from copyreg import clear_extension_cache
|
193 |
for chat in st.session_state.history:
|
194 |
st_message(**chat)
|
|
|
178 |
if "history" not in st.session_state:
|
179 |
st.session_state.history = []
|
180 |
st.title("Hello bot: ")
|
|
|
181 |
def generate_answer():
|
182 |
tokenizer, model = get_models()
|
183 |
user_message = st.session_state.input_text
|
|
|
188 |
) # .replace("<s>", "").replace("</s>", "")
|
189 |
st.session_state.history.append({"message": user_message, "is_user": True})
|
190 |
st.session_state.history.append({"message": message_bot, "is_user": False})
|
191 |
+
st.text_input("Talk to the bot", key="input_text", on_change=generate_answer)
|
192 |
from copyreg import clear_extension_cache
|
193 |
for chat in st.session_state.history:
|
194 |
st_message(**chat)
|