JPBianchi commited on
Commit
2e4b5f4
1 Parent(s): 0a29650

changed finetune toggle into button

Browse files
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -203,9 +203,9 @@ def download_model(model_name_or_path, model_local_path):
203
  model = SentenceTransformer(model_name_or_path)
204
  st.sidebar.write(f"Model {model_name_or_path} downloaded")
205
 
206
- models_urls[model_name_or_path] = model_local_path
207
- model.save(model_local_path)
208
- # st.sidebar.write(f"Model {model_name_or_path} saved to {model_new_path}")
209
 
210
  #%%
211
  # for streamlit online, we must download the model from google drive
@@ -301,7 +301,7 @@ def main():
301
  st.write("Experimental and time limited 2'")
302
  c1,c2 = st.columns([8,1])
303
  with c1:
304
- finetune_model = st.toggle('Finetune on Modal A100 GPU', False)
305
  if we_are_not_online or we_are_online:
306
  if finetune_model:
307
  from finetune_backend import finetune
@@ -348,7 +348,7 @@ def main():
348
 
349
  c1,c2 = st.columns([8,1])
350
  with c1:
351
- show_metrics = st.button('Show Metrics on Golden set', False)
352
  if show_metrics:
353
  # _, center, _ = st.columns([3, 5, 3])
354
  # with center:
@@ -356,19 +356,19 @@ def main():
356
  with c2:
357
  with st.spinner(''):
358
  metrics = execute_evaluation(golden_dataset, class_name, client, alpha=alpha_input)
359
- if show_metrics:
360
- kw_hit_rate = metrics['kw_hit_rate']
361
- kw_mrr = metrics['kw_mrr']
362
- hybrid_hit_rate = metrics['hybrid_hit_rate']
363
- vector_hit_rate = metrics['vector_hit_rate']
364
- vector_mrr = metrics['vector_mrr']
365
- total_misses = metrics['total_misses']
366
-
367
- st.text(f"KW hit rate: {kw_hit_rate}")
368
- st.text(f"Vector hit rate: {vector_hit_rate}")
369
- st.text(f"Hybrid hit rate: {hybrid_hit_rate}")
370
- st.text(f"Hybrid MRR: {vector_mrr}")
371
- st.text(f"Total misses: {total_misses}")
372
 
373
 
374
  st.write("----------")
 
203
  model = SentenceTransformer(model_name_or_path)
204
  st.sidebar.write(f"Model {model_name_or_path} downloaded")
205
 
206
+ models_urls[model_name_or_path] = model_local_path
207
+ model.save(model_local_path)
208
+ # st.sidebar.write(f"Model {model_name_or_path} saved to {model_new_path}")
209
 
210
  #%%
211
  # for streamlit online, we must download the model from google drive
 
301
  st.write("Experimental and time limited 2'")
302
  c1,c2 = st.columns([8,1])
303
  with c1:
304
+ finetune_model = st.button('Finetune on Modal A100 GPU')
305
  if we_are_not_online or we_are_online:
306
  if finetune_model:
307
  from finetune_backend import finetune
 
348
 
349
  c1,c2 = st.columns([8,1])
350
  with c1:
351
+ show_metrics = st.button('Show Metrics on Golden set')
352
  if show_metrics:
353
  # _, center, _ = st.columns([3, 5, 3])
354
  # with center:
 
356
  with c2:
357
  with st.spinner(''):
358
  metrics = execute_evaluation(golden_dataset, class_name, client, alpha=alpha_input)
359
+ with c1:
360
+ kw_hit_rate = metrics['kw_hit_rate']
361
+ kw_mrr = metrics['kw_mrr']
362
+ hybrid_hit_rate = metrics['hybrid_hit_rate']
363
+ vector_hit_rate = metrics['vector_hit_rate']
364
+ vector_mrr = metrics['vector_mrr']
365
+ total_misses = metrics['total_misses']
366
+
367
+ st.text(f"KW hit rate: {kw_hit_rate}")
368
+ st.text(f"Vector hit rate: {vector_hit_rate}")
369
+ st.text(f"Hybrid hit rate: {hybrid_hit_rate}")
370
+ st.text(f"Hybrid MRR: {vector_mrr}")
371
+ st.text(f"Total misses: {total_misses}")
372
 
373
 
374
  st.write("----------")