Update app.py
Browse files
app.py
CHANGED
@@ -253,7 +253,7 @@ def summarize_findings(combined_response: str) -> str:
|
|
253 |
|
254 |
return summary.strip()
|
255 |
|
256 |
-
def update_progress(current, total, stage=""):
|
257 |
progress = f"{stage} - {current}/{total}" if stage else f"{current}/{total}"
|
258 |
return {"value": progress, "visible": True, "label": f"Progress: {progress}"}
|
259 |
|
@@ -364,7 +364,7 @@ Patient Record Excerpt (Chunk {chunk_idx} of {len(chunks)}):
|
|
364 |
history.append({"role": "assistant", "content": ""})
|
365 |
outputs.update({
|
366 |
"chatbot": history,
|
367 |
-
"progress_text": update_progress(chunk_idx, len(chunks)
|
368 |
})
|
369 |
yield outputs
|
370 |
|
@@ -375,7 +375,7 @@ Patient Record Excerpt (Chunk {chunk_idx} of {len(chunks)}):
|
|
375 |
chunk_response = update["content"]
|
376 |
outputs.update({
|
377 |
"chatbot": history,
|
378 |
-
"progress_text": update_progress(chunk_idx, len(chunks)
|
379 |
})
|
380 |
yield outputs
|
381 |
|
|
|
253 |
|
254 |
return summary.strip()
|
255 |
|
256 |
+
def update_progress(current: int, total: int, stage: str = "") -> Dict[str, Any]:
|
257 |
progress = f"{stage} - {current}/{total}" if stage else f"{current}/{total}"
|
258 |
return {"value": progress, "visible": True, "label": f"Progress: {progress}"}
|
259 |
|
|
|
364 |
history.append({"role": "assistant", "content": ""})
|
365 |
outputs.update({
|
366 |
"chatbot": history,
|
367 |
+
"progress_text": update_progress(chunk_idx, len(chunks), "Analyzing")
|
368 |
})
|
369 |
yield outputs
|
370 |
|
|
|
375 |
chunk_response = update["content"]
|
376 |
outputs.update({
|
377 |
"chatbot": history,
|
378 |
+
"progress_text": update_progress(chunk_idx, len(chunks), "Analyzing")
|
379 |
})
|
380 |
yield outputs
|
381 |
|