Spaces:
Running
Running
removed finetuning and metrics when online
Browse files
app.py
CHANGED
@@ -244,11 +244,6 @@ guest_list = sorted(list(set([d['guest'] for d in data])))
|
|
244 |
def main():
|
245 |
|
246 |
with st.sidebar:
|
247 |
-
# moved it to main area
|
248 |
-
# guest = st.selectbox('Select Guest',
|
249 |
-
# options=guest_list,
|
250 |
-
# index=None,
|
251 |
-
# placeholder='Select Guest')
|
252 |
_, center, _ = st.columns([3, 5, 3])
|
253 |
with center:
|
254 |
st.text("Search Lab")
|
@@ -297,11 +292,11 @@ def main():
|
|
297 |
shutil.rmtree(model_path)
|
298 |
st.write("Models deleted")
|
299 |
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
if finetune_model:
|
306 |
from finetune_backend import finetune
|
307 |
if 'finetuned' in model_name_or_path:
|
@@ -323,8 +318,8 @@ def main():
|
|
323 |
# TODO: add model to Weaviate and to model list
|
324 |
except Exception:
|
325 |
st.write("Model not found on HF or error")
|
326 |
-
|
327 |
-
|
328 |
|
329 |
check_model(model_name_or_path)
|
330 |
try:
|
@@ -345,32 +340,33 @@ def main():
|
|
345 |
|
346 |
st.write("----------")
|
347 |
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
with
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
|
|
374 |
|
375 |
|
376 |
st.write("----------")
|
|
|
244 |
def main():
|
245 |
|
246 |
with st.sidebar:
|
|
|
|
|
|
|
|
|
|
|
247 |
_, center, _ = st.columns([3, 5, 3])
|
248 |
with center:
|
249 |
st.text("Search Lab")
|
|
|
292 |
shutil.rmtree(model_path)
|
293 |
st.write("Models deleted")
|
294 |
|
295 |
+
if we_are_not_online:
|
296 |
+
st.write("Experimental and time limited 2'")
|
297 |
+
c1,c2 = st.columns([8,1])
|
298 |
+
with c1:
|
299 |
+
finetune_model = st.button('Finetune on Modal A100 GPU')
|
300 |
if finetune_model:
|
301 |
from finetune_backend import finetune
|
302 |
if 'finetuned' in model_name_or_path:
|
|
|
318 |
# TODO: add model to Weaviate and to model list
|
319 |
except Exception:
|
320 |
st.write("Model not found on HF or error")
|
321 |
+
else:
|
322 |
+
st.write("Finetuning not available on Streamlit online because of space limitations")
|
323 |
|
324 |
check_model(model_name_or_path)
|
325 |
try:
|
|
|
340 |
|
341 |
st.write("----------")
|
342 |
|
343 |
+
if we_are_not_online:
|
344 |
+
c1,c2 = st.columns([8,1])
|
345 |
+
with c1:
|
346 |
+
show_metrics = st.button('Show Metrics on Golden set')
|
347 |
+
if show_metrics:
|
348 |
+
# we must add it because the hybrid search toggle could hide it
|
349 |
+
alpha_input2 = st.slider(label='Alpha',min_value=0.00, max_value=1.00, value=0.40, step=0.05, key=2)
|
350 |
+
|
351 |
+
# _, center, _ = st.columns([3, 5, 3])
|
352 |
+
# with center:
|
353 |
+
# st.text("Metrics")
|
354 |
+
with c2:
|
355 |
+
with st.spinner(''):
|
356 |
+
metrics = execute_evaluation(golden_dataset, class_name, client, alpha=alpha_input2)
|
357 |
+
with c1:
|
358 |
+
kw_hit_rate = metrics['kw_hit_rate']
|
359 |
+
kw_mrr = metrics['kw_mrr']
|
360 |
+
hybrid_hit_rate = metrics['hybrid_hit_rate']
|
361 |
+
vector_hit_rate = metrics['vector_hit_rate']
|
362 |
+
vector_mrr = metrics['vector_mrr']
|
363 |
+
total_misses = metrics['total_misses']
|
364 |
+
|
365 |
+
st.text(f"KW hit rate: {kw_hit_rate}")
|
366 |
+
st.text(f"Vector hit rate: {vector_hit_rate}")
|
367 |
+
st.text(f"Hybrid hit rate: {hybrid_hit_rate}")
|
368 |
+
st.text(f"Hybrid MRR: {vector_mrr}")
|
369 |
+
st.text(f"Total misses: {total_misses}")
|
370 |
|
371 |
|
372 |
st.write("----------")
|