JPBianchi commited on
Commit
2f7a3b7
1 Parent(s): 0e2249c

added models deletion

Browse files
Files changed (1) hide show
  1. app.py +14 -10
app.py CHANGED
@@ -286,7 +286,18 @@ def main():
286
  model_name_or_path = st.selectbox(label='Model Name:', options=available_models,
287
  index=available_models.index(model_default),
288
  placeholder='Select Model')
289
-
 
 
 
 
 
 
 
 
 
 
 
290
  st.write("Experimental and time limited 2'")
291
  c1,c2 = st.columns([8,1])
292
  with c1:
@@ -337,7 +348,7 @@ def main():
337
 
338
  c1,c2 = st.columns([8,1])
339
  with c1:
340
- show_metrics = st.toggle('Show Metrics on Golden set', False)
341
  if show_metrics:
342
  # _, center, _ = st.columns([3, 5, 3])
343
  # with center:
@@ -358,14 +369,7 @@ def main():
358
  st.text(f"Hybrid hit rate: {hybrid_hit_rate}")
359
  st.text(f"Hybrid MRR: {vector_mrr}")
360
  st.text(f"Total misses: {total_misses}")
361
-
362
- delete_models = st.button('Delete all models')
363
- if delete_models:
364
- for model in os.listdir("models"):
365
- model_path = os.path.join("models", model)
366
- if os.path.isdir(model_path):
367
- shutil.rmtree(model_path)
368
- st.write("Models deleted")
369
 
370
  st.write("----------")
371
 
 
286
  model_name_or_path = st.selectbox(label='Model Name:', options=available_models,
287
  index=available_models.index(model_default),
288
  placeholder='Select Model')
289
+
290
+ delete_models = st.button('Delete models')
291
+ if delete_models:
292
+ # model_path = os.path.join("models", model_name_or_path.split('/')[-1])
293
+ # if os.path.isdir(model_path):
294
+ # shutil.rmtree(model_path)
295
+ for model in os.listdir("models"):
296
+ model_path = os.path.join("models", model)
297
+ if os.path.isdir(model_path) and 'finetuned-all-mpnet-base-v2-300' not in model_path:
298
+ shutil.rmtree(model_path)
299
+ st.write("Models deleted")
300
+
301
  st.write("Experimental and time limited 2'")
302
  c1,c2 = st.columns([8,1])
303
  with c1:
 
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:
 
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("----------")
375