Spaces:
Runtime error
Runtime error
Update app.py
Browse files56 unmodified lines5758596061626316 unmodified lines8081828384858640 unmodified lines12712812913013113213313413513613713822 unmodified lines16116216316456 unmodified linesst.session_state.repetion_penalty = 1if "rag_enabled" not in st.session_state :st.session_state.rag_enabled = Falseif "chat_bot" not in st.session_state :st.session_state.chat_bot = "Mixtral 8x7B v0.1"16 unmodified linesst.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 linestokens_per_second = total_tokens_processed // elapsed_timelen_response = (len(prompt.split()) + len(full_response.split())) * 1.25col1, col2, col3 = st.columns(3)with col1 :st.write(f"**{tokens_per_second} token/secondi**")with col2 :st.write(f"**{int(len_response)} tokens generati**")return full_response22 unmodified linesst.session_state.history.append([prompt, full_response])st.session_state.messages.append({"role": "assistant", "content": full_response})st.success('Generazione Completata', icon="✅")56 unmodified lines5758596061626316 unmodified lines80818283848540 unmodified lines12612712812913013113213313413513613713813914014122 unmodified lines16416516616756 unmodified linesst.session_state.repetion_penalty = 1if "rag_enabled" not in st.session_state :st.session_state.rag_enabled = Trueif "chat_bot" not in st.session_state :st.session_state.chat_bot = "Mixtral 8x7B v0.1"16 unmodified linesst.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)with st.sidebar:retrieval_settings()40 unmodified linestokens_per_second = total_tokens_processed // elapsed_timelen_response = (len(prompt.split()) + len(full_response.split())) * 1.25col1, col2, col3 = st.columns(3)with col1 :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_response22 unmodified linesst.session_state.history.append([prompt, full_response])st.session_state.messages.append({"role": "assistant", "content": full_response})st.success('Generazione Completata')
app.py+9-6