Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,7 @@ import gradio as gr
|
|
| 7 |
from searchschool import (
|
| 8 |
STATE_HF_FILES,
|
| 9 |
DEFAULT_STATE_KEY,
|
|
|
|
| 10 |
load_master_for_state,
|
| 11 |
update_blocks,
|
| 12 |
search_candidates,
|
|
@@ -66,6 +67,26 @@ with gr.Blocks(title="State School Fuzzy Matcher (with gated Admin)") as demo:
|
|
| 66 |
interactive=False
|
| 67 |
)
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
# ----- ADMIN TAB (hidden until unlock) -----
|
| 70 |
with gr.Tab("Admin"):
|
| 71 |
gr.Markdown("### Admin — Patterns (enter password to unlock editor)")
|
|
|
|
| 7 |
from searchschool import (
|
| 8 |
STATE_HF_FILES,
|
| 9 |
DEFAULT_STATE_KEY,
|
| 10 |
+
on_search_web,
|
| 11 |
load_master_for_state,
|
| 12 |
update_blocks,
|
| 13 |
search_candidates,
|
|
|
|
| 67 |
interactive=False
|
| 68 |
)
|
| 69 |
|
| 70 |
+
# ensure at top of file you have: from web_search import tavily_search
|
| 71 |
+
|
| 72 |
+
# --- inside Search tab UI, after search_btn etc. ---
|
| 73 |
+
gr.Markdown("### Web search — find UDISE codes on the web")
|
| 74 |
+
gr.Markdown("### Use Judiciously - Only if you didnt find or couldnt confirm the school in the above list")
|
| 75 |
+
search_web_btn = gr.Button("Search Web")
|
| 76 |
+
|
| 77 |
+
web_schools_table = gr.Dataframe(
|
| 78 |
+
headers=["School_Name", "State", "District", "Block", "UDISE_Code"],
|
| 79 |
+
datatype=["str", "str", "str", "str", "str"],
|
| 80 |
+
interactive=False
|
| 81 |
+
)
|
| 82 |
+
|
| 83 |
+
search_web_btn.click(
|
| 84 |
+
fn=on_search_web,
|
| 85 |
+
inputs=[school_input, state_dd, district_dd, block_dd],
|
| 86 |
+
outputs=[web_schools_table]
|
| 87 |
+
)
|
| 88 |
+
|
| 89 |
+
|
| 90 |
# ----- ADMIN TAB (hidden until unlock) -----
|
| 91 |
with gr.Tab("Admin"):
|
| 92 |
gr.Markdown("### Admin — Patterns (enter password to unlock editor)")
|