Spaces:
Runtime error
Runtime error
Update app.py
Browse files56 unmodified lines575859606061626316 unmodified lines8081828383848540 unmodified lines12612712813012913013213313113213313413513613713813914014122 unmodified lines16416516616416756 unmodified lines st.session_state.repetion_penalty = 1
if "rag_enabled" not in st.session_state : st.session_state.rag_enabled = False st.session_state.rag_enabled = True
if "chat_bot" not in st.session_state : st.session_state.chat_bot = "Mixtral 8x7B v0.1"16 unmodified lines st.session_state.chat_bot = st.sidebar.radio('Seleziona Modello:', [key for key, value in CHAT_BOTS.items() ]) st.session_state.temp = st.slider(label="Creatività", min_value=0.0, max_value=1.0, step=0.1, value=0.9) st.session_state.max_tokens = st.slider(label="Lunghezza Output", min_value = 64, max_value=2048, step= 32, value=512) st.session_state.repetion_penalty = st.slider(label="Penalità Ripetizione", min_value=0., max_value=1., step=0.1, value=1. )
with st.sidebar: retrieval_settings()40 unmodified lines tokens_per_second = total_tokens_processed // elapsed_time len_response = (len(prompt.split()) + len(full_response.split())) * 1.25 col1, col2, col3 = st.columns(3)
with col1 : st.write(f"**{tokens_per_second} token/secondi**") st.write(f"**{elapsed_time} secondi**")
with col2 : st.write(f"**{int(len_response)} tokens generati**")
with col3 : st.write(f"**{tokens_per_second} token/secondi**") return full_response
22 unmodified lines
st.session_state.history.append([prompt, full_response]) st.session_state.messages.append({"role": "assistant", "content": full_response}) st.success('Generazione Completata', icon="✅") st.success('Generazione Completata')app.py+9-6