Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -69,6 +69,13 @@ def generate(user_input, history, temperature=None, max_new_tokens=512, top_p=0.
|
|
69 |
if "history" not in st.session_state:
|
70 |
st.session_state.history = []
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
st.text_area("Salida del Chatbot", value=output, height=400, key="output_text", disabled=True)
|
73 |
user_input = st.text_input(label="Ingresa tu mensaje", value="")
|
74 |
|
|
|
69 |
if "history" not in st.session_state:
|
70 |
st.session_state.history = []
|
71 |
|
72 |
+
if st.session_state.history:
|
73 |
+
user_input = st.session_state.history[-1][0]
|
74 |
+
output, audio_bytes = generate(user_input, history=st.session_state.history)
|
75 |
+
st.session_state.history[-1] = (user_input, output)
|
76 |
+
else:
|
77 |
+
output, audio_bytes = "", ""
|
78 |
+
|
79 |
st.text_area("Salida del Chatbot", value=output, height=400, key="output_text", disabled=True)
|
80 |
user_input = st.text_input(label="Ingresa tu mensaje", value="")
|
81 |
|