salomonsky commited on
Commit
6c29cef
·
verified ·
1 Parent(s): 7c93af5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
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