Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ DB_FILE = "ultimate_safety_vault.json"
|
|
| 15 |
try:
|
| 16 |
with open(DB_FILE, 'r') as f:
|
| 17 |
db = json.load(f)
|
| 18 |
-
print(f"β
Database loaded: {len(db)} entries.")
|
| 19 |
except:
|
| 20 |
print("β DB not found.")
|
| 21 |
db = {}
|
|
@@ -149,7 +149,11 @@ def pipeline_generator(user_query):
|
|
| 149 |
|
| 150 |
# --- 4. UI LAYOUT ---
|
| 151 |
|
| 152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
with gr.Accordion("π Technical Report & Database Coverage", open=False):
|
| 154 |
gr.Markdown(
|
| 155 |
"""
|
|
@@ -209,12 +213,10 @@ def pipeline_generator(user_query):
|
|
| 209 |
with gr.Row():
|
| 210 |
with gr.Column(scale=1):
|
| 211 |
gr.Markdown("### π§ 1. Semantic Parser Output")
|
| 212 |
-
# Using gr.JSON to clearly show the extraction
|
| 213 |
out_parser = gr.JSON(label="Extracted Intent")
|
| 214 |
|
| 215 |
with gr.Column(scale=2):
|
| 216 |
gr.Markdown("### π 2. Database Guardrail Output")
|
| 217 |
-
# Using gr.Code to show raw text data cleanly
|
| 218 |
out_db = gr.Code(label="Verified Content (Source of Truth)", language="yaml", interactive=False)
|
| 219 |
|
| 220 |
# ROW 2: FINAL RESULT
|
|
|
|
| 15 |
try:
|
| 16 |
with open(DB_FILE, 'r') as f:
|
| 17 |
db = json.load(f)
|
| 18 |
+
print(f"β
Database loaded: {len(db)} generic entries.")
|
| 19 |
except:
|
| 20 |
print("β DB not found.")
|
| 21 |
db = {}
|
|
|
|
| 149 |
|
| 150 |
# --- 4. UI LAYOUT ---
|
| 151 |
|
| 152 |
+
with gr.Blocks(theme=gr.themes.Soft(), title="PharmaVault Research Demo") as demo:
|
| 153 |
+
|
| 154 |
+
gr.Markdown("# π‘οΈ PharmaVault AI: Verified Drug Safety Reasoning Engine")
|
| 155 |
+
|
| 156 |
+
# --- RESEARCH INFO ACCORDION ---
|
| 157 |
with gr.Accordion("π Technical Report & Database Coverage", open=False):
|
| 158 |
gr.Markdown(
|
| 159 |
"""
|
|
|
|
| 213 |
with gr.Row():
|
| 214 |
with gr.Column(scale=1):
|
| 215 |
gr.Markdown("### π§ 1. Semantic Parser Output")
|
|
|
|
| 216 |
out_parser = gr.JSON(label="Extracted Intent")
|
| 217 |
|
| 218 |
with gr.Column(scale=2):
|
| 219 |
gr.Markdown("### π 2. Database Guardrail Output")
|
|
|
|
| 220 |
out_db = gr.Code(label="Verified Content (Source of Truth)", language="yaml", interactive=False)
|
| 221 |
|
| 222 |
# ROW 2: FINAL RESULT
|