Spaces:
Sleeping
Sleeping
andy commited on
Commit ·
8b5a069
1
Parent(s): 26fde75
update
Browse files- README.md +1 -1
- app.py +2 -2
- data_loader.py +1 -1
README.md
CHANGED
|
@@ -18,7 +18,7 @@ WQF7002 Assignment 1. It uses **native tool calling** with
|
|
| 18 |
|
| 19 |
Paste an order with ingredient names, amounts and units. The model chooses Python
|
| 20 |
tools; Python validates arguments, resolves products and calculates dose verdicts
|
| 21 |
-
from `
|
| 22 |
function call and guardrail, and full JSON for the latest tool call.
|
| 23 |
|
| 24 |
## Run locally (Python 3.12, including Mac)
|
|
|
|
| 18 |
|
| 19 |
Paste an order with ingredient names, amounts and units. The model chooses Python
|
| 20 |
tools; Python validates arguments, resolves products and calculates dose verdicts
|
| 21 |
+
from `Diagnosis, Ingredients, Dosage.xlsx` in the repository root. The interface shows the chat, every
|
| 22 |
function call and guardrail, and full JSON for the latest tool call.
|
| 23 |
|
| 24 |
## Run locally (Python 3.12, including Mac)
|
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import json
|
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
from agent import run_turn
|
| 7 |
-
from data_loader import DATA
|
| 8 |
from llm_backends import BACKEND, MODEL_ID, get_backend
|
| 9 |
|
| 10 |
backend = get_backend()
|
|
@@ -31,7 +31,7 @@ def clear():
|
|
| 31 |
|
| 32 |
|
| 33 |
status = (f"Data: unavailable ({DATA.error})" if DATA.error else
|
| 34 |
-
f"Data: loaded {len(DATA.ingredients)} ingredients, {len(DATA.diagnoses)} diagnoses from
|
| 35 |
with gr.Blocks(title="PharmaCheck — Formulary Dose Checker") as demo:
|
| 36 |
gr.Markdown("# PharmaCheck — Formulary Dose Checker")
|
| 37 |
gr.Markdown(f"{status}\n\nModel: {MODEL_ID} via {BACKEND}")
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
from agent import run_turn
|
| 7 |
+
from data_loader import DATA, DATA_PATH
|
| 8 |
from llm_backends import BACKEND, MODEL_ID, get_backend
|
| 9 |
|
| 10 |
backend = get_backend()
|
|
|
|
| 31 |
|
| 32 |
|
| 33 |
status = (f"Data: unavailable ({DATA.error})" if DATA.error else
|
| 34 |
+
f"Data: loaded {len(DATA.ingredients)} ingredients, {len(DATA.diagnoses)} diagnoses from {DATA_PATH.name}")
|
| 35 |
with gr.Blocks(title="PharmaCheck — Formulary Dose Checker") as demo:
|
| 36 |
gr.Markdown("# PharmaCheck — Formulary Dose Checker")
|
| 37 |
gr.Markdown(f"{status}\n\nModel: {MODEL_ID} via {BACKEND}")
|
data_loader.py
CHANGED
|
@@ -8,7 +8,7 @@ from rapidfuzz import fuzz, process
|
|
| 8 |
|
| 9 |
from aliases import ALIASES
|
| 10 |
|
| 11 |
-
DATA_PATH = Path(__file__).parent / "
|
| 12 |
|
| 13 |
|
| 14 |
def clean(value):
|
|
|
|
| 8 |
|
| 9 |
from aliases import ALIASES
|
| 10 |
|
| 11 |
+
DATA_PATH = Path(__file__).resolve().parent / "Diagnosis, Ingredients, Dosage.xlsx"
|
| 12 |
|
| 13 |
|
| 14 |
def clean(value):
|