Update app.py
Browse files
app.py
CHANGED
@@ -194,8 +194,8 @@ def compare_embeddings(file, query, model_types, model_names, split_strategy, ch
|
|
194 |
stats = calculate_statistics(results, search_time)
|
195 |
stats["model"] = f"{model_type} - {model_name}"
|
196 |
|
197 |
-
all_results.append(
|
198 |
-
all_stats.append(
|
199 |
|
200 |
# Flatten the return values to match Gradio's expectation for each output
|
201 |
return [item for sublist in all_results for item in sublist] + [item for sublist in all_stats for item in sublist]
|
@@ -217,8 +217,8 @@ iface = gr.Interface(
|
|
217 |
gr.Slider(1, 10, step=1, value=5, label="Top K")
|
218 |
],
|
219 |
#outputs=[gr.DataFrame(label="Results"), gr.DataFrame(label="Statistics")] * len(MODELS),
|
220 |
-
outputs = [gr.
|
221 |
-
[gr.
|
222 |
title="Embedding Comparison Tool",
|
223 |
description="Compare different embedding models and retrieval strategies"
|
224 |
)
|
|
|
194 |
stats = calculate_statistics(results, search_time)
|
195 |
stats["model"] = f"{model_type} - {model_name}"
|
196 |
|
197 |
+
all_results.append(results)
|
198 |
+
all_stats.append(stats)
|
199 |
|
200 |
# Flatten the return values to match Gradio's expectation for each output
|
201 |
return [item for sublist in all_results for item in sublist] + [item for sublist in all_stats for item in sublist]
|
|
|
217 |
gr.Slider(1, 10, step=1, value=5, label="Top K")
|
218 |
],
|
219 |
#outputs=[gr.DataFrame(label="Results"), gr.DataFrame(label="Statistics")] * len(MODELS),
|
220 |
+
outputs = [gr.Text(label=f"Results {i+1}") for i in range(len(MODELS)-1)] + \
|
221 |
+
[gr.Text(label=f"Statistics {i+1}") for i in range(len(MODELS)-1)],
|
222 |
title="Embedding Comparison Tool",
|
223 |
description="Compare different embedding models and retrieval strategies"
|
224 |
)
|