Spaces:
Running
Running
add individual model endpoint
Browse files
app.py
CHANGED
|
@@ -628,6 +628,38 @@ with gr.Blocks(css="""
|
|
| 628 |
btn_clear4.click(lambda: ("", None), None, [inp4, out4])
|
| 629 |
btn_submit4.click(hybrid_search, inp4, out4, api_name="hybrid_search")
|
| 630 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 631 |
with gr.Tab("Ablation Study"):
|
| 632 |
gr.Markdown("### Metrics & Latency")
|
| 633 |
gr.Markdown("Unggah file `ground_truth.csv` Anda untuk menjalankan *batch testing* dan membandingkan skenario.")
|
|
|
|
| 628 |
btn_clear4.click(lambda: ("", None), None, [inp4, out4])
|
| 629 |
btn_submit4.click(hybrid_search, inp4, out4, api_name="hybrid_search")
|
| 630 |
|
| 631 |
+
with gr.Tab("Ablation Endpoints (API)"):
|
| 632 |
+
gr.Markdown("### Individual Model")
|
| 633 |
+
|
| 634 |
+
with gr.Row():
|
| 635 |
+
with gr.Column(scale=1):
|
| 636 |
+
inp5 = gr.Textbox(label="Masukkan kueri teks")
|
| 637 |
+
|
| 638 |
+
with gr.Row(elem_classes="btn-row"):
|
| 639 |
+
btn_bm25 = gr.Button("BM25 Only", variant="primary")
|
| 640 |
+
btn_dense = gr.Button("Dense Only", variant="primary")
|
| 641 |
+
|
| 642 |
+
with gr.Row(elem_classes="btn-row"):
|
| 643 |
+
btn_sem_no_gem = gr.Button("Semantic (No Gemini)", variant="primary")
|
| 644 |
+
btn_hyb_no_gem = gr.Button("Hybrid (No Gemini)", variant="primary")
|
| 645 |
+
|
| 646 |
+
with gr.Row():
|
| 647 |
+
btn_clear5 = gr.Button("Clear", variant="secondary")
|
| 648 |
+
|
| 649 |
+
with gr.Column(scale=1):
|
| 650 |
+
out5 = gr.JSON(label="Hasil Pencarian Ablation")
|
| 651 |
+
|
| 652 |
+
# Clear Button
|
| 653 |
+
btn_clear5.click(lambda: ("", None), None, [inp5, out5])
|
| 654 |
+
|
| 655 |
+
# Registrasi Event dan API Name
|
| 656 |
+
btn_bm25.click(bm25_only, inputs=[inp5], outputs=[out5], api_name="bm25_only")
|
| 657 |
+
btn_dense.click(dense_only, inputs=[inp5], outputs=[out5], api_name="dense_only")
|
| 658 |
+
btn_sem_no_gem.click(semantic_no_gemini, inputs=[inp5], outputs=[out5], api_name="semantic_no_gemini")
|
| 659 |
+
btn_hyb_no_gem.click(hybrid_search_no_gemini, inputs=[inp5], outputs=[out5], api_name="hybrid_search_no_gemini")
|
| 660 |
+
|
| 661 |
+
inp5.submit(dense_only, inputs=[inp5], outputs=[out5])
|
| 662 |
+
|
| 663 |
with gr.Tab("Ablation Study"):
|
| 664 |
gr.Markdown("### Metrics & Latency")
|
| 665 |
gr.Markdown("Unggah file `ground_truth.csv` Anda untuk menjalankan *batch testing* dan membandingkan skenario.")
|