Spaces:
Runtime error
Runtime error
Jesse Liu commited on
Commit ·
d8f541a
1
Parent(s): 53964bd
Sync latest app + data (clinician groups, jsonl)
Browse files- chatgpt.py +4 -0
chatgpt.py
CHANGED
|
@@ -830,6 +830,7 @@ with gr.Blocks() as app:
|
|
| 830 |
}
|
| 831 |
jsonl_loaded = True
|
| 832 |
print(f"Loaded {len(eval_data_by_patient)} patients from JSONL")
|
|
|
|
| 833 |
|
| 834 |
# Fallback to old format if JSONL not found
|
| 835 |
if (not jsonl_loaded) and os.path.exists(summaries_dir):
|
|
@@ -879,6 +880,7 @@ with gr.Blocks() as app:
|
|
| 879 |
del rec['_summary_mtime']
|
| 880 |
|
| 881 |
# Merge per-admission structured JSONs (input_text, summary, admittime)
|
|
|
|
| 882 |
per_adm_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'per_admission_results_30patient_2ad')
|
| 883 |
if (not jsonl_loaded) and os.path.exists(per_adm_dir):
|
| 884 |
for fname in os.listdir(per_adm_dir):
|
|
@@ -965,6 +967,8 @@ with gr.Blocks() as app:
|
|
| 965 |
|
| 966 |
# Precompute patient id list for UI (single admission per patient)
|
| 967 |
patient_ids_list = sorted(list(eval_data_by_patient.keys()))
|
|
|
|
|
|
|
| 968 |
|
| 969 |
with gr.Tabs():
|
| 970 |
with gr.TabItem("Expert Evaluation"):
|
|
|
|
| 830 |
}
|
| 831 |
jsonl_loaded = True
|
| 832 |
print(f"Loaded {len(eval_data_by_patient)} patients from JSONL")
|
| 833 |
+
print(f"Patient IDs: {sorted(list(eval_data_by_patient.keys()))}")
|
| 834 |
|
| 835 |
# Fallback to old format if JSONL not found
|
| 836 |
if (not jsonl_loaded) and os.path.exists(summaries_dir):
|
|
|
|
| 880 |
del rec['_summary_mtime']
|
| 881 |
|
| 882 |
# Merge per-admission structured JSONs (input_text, summary, admittime)
|
| 883 |
+
# Only load if JSONL was not loaded (to avoid duplicate patients)
|
| 884 |
per_adm_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'per_admission_results_30patient_2ad')
|
| 885 |
if (not jsonl_loaded) and os.path.exists(per_adm_dir):
|
| 886 |
for fname in os.listdir(per_adm_dir):
|
|
|
|
| 967 |
|
| 968 |
# Precompute patient id list for UI (single admission per patient)
|
| 969 |
patient_ids_list = sorted(list(eval_data_by_patient.keys()))
|
| 970 |
+
print(f"[DEBUG] Total patients in UI list: {len(patient_ids_list)}")
|
| 971 |
+
print(f"[DEBUG] Patient IDs: {patient_ids_list[:10]}..." if len(patient_ids_list) > 10 else f"[DEBUG] Patient IDs: {patient_ids_list}")
|
| 972 |
|
| 973 |
with gr.Tabs():
|
| 974 |
with gr.TabItem("Expert Evaluation"):
|