Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -46,6 +46,9 @@ if st.session_state.recent_questions:
|
|
46 |
|
47 |
print(recent_qns)
|
48 |
|
|
|
|
|
|
|
49 |
# Display Recent Questions
|
50 |
st.sidebar.title("Overall RMSE")
|
51 |
rmse_values = [q["metrics"]["RMSE"] for q in recent_qns if "metrics" in q and "RMSE" in q["metrics"]]
|
@@ -123,27 +126,12 @@ if st.button("Submit"):
|
|
123 |
st.subheader("Response")
|
124 |
st.text_area("Generated Response:", value=st.session_state.response, height=150, disabled=True)
|
125 |
|
|
|
|
|
|
|
126 |
col1, col2 = st.columns([1, 3]) # Creating two columns for button and metrics display
|
127 |
|
128 |
-
|
129 |
-
with col1:
|
130 |
-
if st.button("Show Metrics"):
|
131 |
-
print("Showing Metrics..")
|
132 |
-
# st.session_state.metrics = calculate_metrics(question, st.session_state.query_dataset, st.session_state.response, st.session_state.retrieved_documents, st.session_state.time_taken_for_response)
|
133 |
-
# recent_ques = st.session_state.recent_questions
|
134 |
-
# for q in recent_ques:
|
135 |
-
# if q["question"] == st.session_state.last_question:
|
136 |
-
# q["metrics"] = st.session_state.metrics
|
137 |
-
|
138 |
-
# st.session_state.recent_questions = recent_ques
|
139 |
-
# Save updated data to file
|
140 |
-
#save_recent_questions(st.session_state.recent_questions)
|
141 |
-
with col2:
|
142 |
-
if st.session_state.metrics is not None:
|
143 |
-
metrics_ = st.session_state.metrics
|
144 |
-
else:
|
145 |
-
metrics_ ={}
|
146 |
-
st.json(metrics_)
|
147 |
|
148 |
|
149 |
|
|
|
46 |
|
47 |
print(recent_qns)
|
48 |
|
49 |
+
if st.sidebar.button("Show Overall Metrics"):
|
50 |
+
print("Showing overall Metrics...")
|
51 |
+
|
52 |
# Display Recent Questions
|
53 |
st.sidebar.title("Overall RMSE")
|
54 |
rmse_values = [q["metrics"]["RMSE"] for q in recent_qns if "metrics" in q and "RMSE" in q["metrics"]]
|
|
|
126 |
st.subheader("Response")
|
127 |
st.text_area("Generated Response:", value=st.session_state.response, height=150, disabled=True)
|
128 |
|
129 |
+
st.subheader("Response Metrics")
|
130 |
+
st.json(st.session_state.metrics, expanded=True)
|
131 |
+
|
132 |
col1, col2 = st.columns([1, 3]) # Creating two columns for button and metrics display
|
133 |
|
134 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
|
136 |
|
137 |
|