nazneen commited on
Commit
49418b5
1 Parent(s): 2f70d2a

added offline files

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -213,14 +213,7 @@ def populate_session(dataset,model):
213
  if "selected_slice" not in st.session_state:
214
  st.session_state["selected_slice"] = None
215
 
216
- loss_quantile = st.sidebar.slider(
217
- "Loss Quantile", min_value=0.5, max_value=1.0,step=0.01,value=0.95
218
- )
219
- data_df['loss'] = data_df['loss'].astype(float)
220
- losses = data_df['loss']
221
- high_loss = losses.quantile(loss_quantile)
222
- data_df['slice'] = 'high-loss'
223
- data_df['slice'] = data_df['slice'].where(data_df['loss'] > high_loss, 'low-loss')
224
 
225
  if __name__ == "__main__":
226
  ### STREAMLIT APP CONGFIG ###
@@ -248,6 +241,14 @@ if __name__ == "__main__":
248
  ##uncomment the next next line to run dynamically and not from file
249
  #populate_session(dataset, model)
250
  data_df = pd.read_parquet('./assets/data/'+dataset+ '_'+ model+'.parquet')
 
 
 
 
 
 
 
 
251
 
252
  with rcol:
253
  with st.spinner(text='loading...'):
 
213
  if "selected_slice" not in st.session_state:
214
  st.session_state["selected_slice"] = None
215
 
216
+
 
 
 
 
 
 
 
217
 
218
  if __name__ == "__main__":
219
  ### STREAMLIT APP CONGFIG ###
 
241
  ##uncomment the next next line to run dynamically and not from file
242
  #populate_session(dataset, model)
243
  data_df = pd.read_parquet('./assets/data/'+dataset+ '_'+ model+'.parquet')
244
+ loss_quantile = st.sidebar.slider(
245
+ "Loss Quantile", min_value=0.5, max_value=1.0,step=0.01,value=0.95
246
+ )
247
+ data_df['loss'] = data_df['loss'].astype(float)
248
+ losses = data_df['loss']
249
+ high_loss = losses.quantile(loss_quantile)
250
+ data_df['slice'] = 'high-loss'
251
+ data_df['slice'] = data_df['slice'].where(data_df['loss'] > high_loss, 'low-loss')
252
 
253
  with rcol:
254
  with st.spinner(text='loading...'):