vamseelatha2002 commited on
Commit
c93e131
·
verified ·
1 Parent(s): 2f35cbd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -81,7 +81,7 @@ if "metrics" not in st.session_state:
81
  if "query_dataset" not in st.session_state:
82
  st.session_state.query_dataset = ''
83
  if "rmse" not in st.session_state:
84
- st.session_state.rmse = {}
85
 
86
  recent_questions = load_recent_questions()
87
 
@@ -149,6 +149,12 @@ st.subheader("Response")
149
  st.text_area("Generated Response:", value=st.session_state.response, height=150, disabled=True)
150
 
151
  col1, col2 = st.columns([1, 3]) # Creating two columns for button and metrics display
 
 
 
 
 
 
152
 
153
  # # Calculate Metrics Button
154
  # with col1:
@@ -172,16 +178,15 @@ with col1:
172
  with col2:
173
  #st.text_area("Metrics:", value=metrics, height=100, disabled=True)
174
  st.json(st.session_state.metrics)
175
-
176
- # Calculate RMSE Button
177
  with col1:
178
  if st.button("Show RMSE"):
179
- st.session_state.rmse = compute_rmse( st.session_state.metrics.values(),st.session_state.response)
180
- else:
181
- metrics_ = {}
 
182
 
183
  with col2:
184
- #st.text_area("RMSE:", value=rmse, height=100, disabled=True)
185
  st.json(st.session_state.rmse)
186
 
187
-
 
81
  if "query_dataset" not in st.session_state:
82
  st.session_state.query_dataset = ''
83
  if "rmse" not in st.session_state:
84
+ st.session_state.rmse = 0.0
85
 
86
  recent_questions = load_recent_questions()
87
 
 
149
  st.text_area("Generated Response:", value=st.session_state.response, height=150, disabled=True)
150
 
151
  col1, col2 = st.columns([1, 3]) # Creating two columns for button and metrics display
152
+ #col3, col4 =st.columns([3,4]) #for RMSE button
153
+
154
+
155
+
156
+ # Display RMSE
157
+ st.json(st.session_state.rmse)
158
 
159
  # # Calculate Metrics Button
160
  # with col1:
 
178
  with col2:
179
  #st.text_area("Metrics:", value=metrics, height=100, disabled=True)
180
  st.json(st.session_state.metrics)
181
+
182
+ # Show RMSE Button
183
  with col1:
184
  if st.button("Show RMSE"):
185
+ if st.session_state.metrics: # Check if metrics exist
186
+ st.session_state.rmse = compute_rmse(st.session_state.metrics.values(), st.session_state.response)
187
+ else:
188
+ st.session_state.rmse = "Metrics not available"
189
 
190
  with col2:
 
191
  st.json(st.session_state.rmse)
192