MatteoScript commited on
Commit
f5b6274
1 Parent(s): 5790dd8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -60,7 +60,7 @@ def init_state() :
60
  st.session_state.split = 30
61
 
62
  if "enable_history" not in st.session_state:
63
- st.session_state.enable_history = False
64
 
65
  if "audio_bytes" not in st.session_state:
66
  st.session_state.audio_bytes = False
@@ -166,7 +166,7 @@ def sidebar():
166
  st.markdown("# Impostazioni Modello")
167
  st.session_state.chat_bot = st.sidebar.radio('Modello:', [key for key, value in CHAT_BOTS.items() ])
168
  st.session_state.numero_generazioni = st.slider(label="Generazioni", min_value = 1, max_value=10, value=1)
169
- st.session_state.enable_history = st.toggle("Storico Messaggi", value=False)
170
  st.session_state.temp = st.slider(label="Creatività", min_value=0.0, max_value=1.0, step=0.1, value=0.9)
171
  st.session_state.max_tokens = st.slider(label="Lunghezza Output", min_value = 2, max_value=2048, step= 32, value=1024)
172
 
@@ -365,7 +365,7 @@ if prompt := st.chat_input("Chatta con BonsiAI..."):
365
  risposta_completa = risposta_completa + '\n' + full_response
366
 
367
  if st.session_state.enable_history:
368
- st.session_state.history.append([prompt, full_response])
369
  else:
370
  st.session_state.history.append(['', ''])
371
  st.success('Generazione Completata')
 
60
  st.session_state.split = 30
61
 
62
  if "enable_history" not in st.session_state:
63
+ st.session_state.enable_history = True
64
 
65
  if "audio_bytes" not in st.session_state:
66
  st.session_state.audio_bytes = False
 
166
  st.markdown("# Impostazioni Modello")
167
  st.session_state.chat_bot = st.sidebar.radio('Modello:', [key for key, value in CHAT_BOTS.items() ])
168
  st.session_state.numero_generazioni = st.slider(label="Generazioni", min_value = 1, max_value=10, value=1)
169
+ st.session_state.enable_history = st.toggle("Storico Messaggi", value=True)
170
  st.session_state.temp = st.slider(label="Creatività", min_value=0.0, max_value=1.0, step=0.1, value=0.9)
171
  st.session_state.max_tokens = st.slider(label="Lunghezza Output", min_value = 2, max_value=2048, step= 32, value=1024)
172
 
 
365
  risposta_completa = risposta_completa + '\n' + full_response
366
 
367
  if st.session_state.enable_history:
368
+ st.session_state.history.append([prompt_originale, full_response])
369
  else:
370
  st.session_state.history.append(['', ''])
371
  st.success('Generazione Completata')