Spaces:
Sleeping
Sleeping
Update src/ai_processor.py
Browse files- src/ai_processor.py +2 -2
src/ai_processor.py
CHANGED
|
@@ -138,7 +138,7 @@ Provide a structured report with:
|
|
| 138 |
return "⚠️ GPU worker unavailable"
|
| 139 |
except Exception:
|
| 140 |
# If `spaces` cannot be imported locally, expose a CPU-safe stub with same signature.
|
| 141 |
-
def
|
| 142 |
patient_info: str,
|
| 143 |
visual_results: Dict,
|
| 144 |
guideline_context: str,
|
|
@@ -420,7 +420,7 @@ Automated analysis provides quantitative measurements; verify via clinical exami
|
|
| 420 |
) -> str:
|
| 421 |
"""Use GPU path when available, fallback otherwise."""
|
| 422 |
try:
|
| 423 |
-
report =
|
| 424 |
patient_info, visual_results, guideline_context, image_pil, max_new_tokens
|
| 425 |
)
|
| 426 |
if report and report.strip() and not report.startswith(("⚠️", "❌")):
|
|
|
|
| 138 |
return "⚠️ GPU worker unavailable"
|
| 139 |
except Exception:
|
| 140 |
# If `spaces` cannot be imported locally, expose a CPU-safe stub with same signature.
|
| 141 |
+
def generate_medgemma_report(
|
| 142 |
patient_info: str,
|
| 143 |
visual_results: Dict,
|
| 144 |
guideline_context: str,
|
|
|
|
| 420 |
) -> str:
|
| 421 |
"""Use GPU path when available, fallback otherwise."""
|
| 422 |
try:
|
| 423 |
+
report = generate_medgemma_report(
|
| 424 |
patient_info, visual_results, guideline_context, image_pil, max_new_tokens
|
| 425 |
)
|
| 426 |
if report and report.strip() and not report.startswith(("⚠️", "❌")):
|