Spaces:
Sleeping
Sleeping
sainathBelagavi
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -54,6 +54,20 @@ def reset_conversation():
|
|
54 |
st.session_state.messages = []
|
55 |
st.experimental_rerun() # Add this line to rerun the app after reset
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
models = [key for key in model_links.keys()]
|
58 |
selected_model = st.sidebar.selectbox("Select Model", models)
|
59 |
temp_values = st.sidebar.slider('Select a temperature value', 0.0, 1.0, (0.5))
|
|
|
54 |
st.session_state.messages = []
|
55 |
st.experimental_rerun() # Add this line to rerun the app after reset
|
56 |
|
57 |
+
def load_conversation_history():
|
58 |
+
history_file = "conversation_history.pickle"
|
59 |
+
if os.path.exists(history_file):
|
60 |
+
with open(history_file, "rb") as f:
|
61 |
+
conversation_history = pickle.load(f)
|
62 |
+
else:
|
63 |
+
conversation_history = []
|
64 |
+
return conversation_history
|
65 |
+
|
66 |
+
def save_conversation_history(conversation_history):
|
67 |
+
history_file = "conversation_history.pickle"
|
68 |
+
with open(history_file, "wb") as f:
|
69 |
+
pickle.dump(conversation_history, f)
|
70 |
+
|
71 |
models = [key for key in model_links.keys()]
|
72 |
selected_model = st.sidebar.selectbox("Select Model", models)
|
73 |
temp_values = st.sidebar.slider('Select a temperature value', 0.0, 1.0, (0.5))
|