Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,36 +22,35 @@ def analyze(
|
|
| 22 |
|
| 23 |
# System-style instruction (non-medical, fixed headings)
|
| 24 |
system_prompt = (
|
| 25 |
-
"""
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
5. Longevity Metrics
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
- Predictive wellness trends (non-medical)
|
| 55 |
"""
|
| 56 |
)
|
| 57 |
|
|
@@ -81,7 +80,6 @@ Lab Values:
|
|
| 81 |
# Call LLM
|
| 82 |
result = pipe(
|
| 83 |
prompt,
|
| 84 |
-
max_new_tokens=3000,
|
| 85 |
do_sample=True,
|
| 86 |
temperature=0.6,
|
| 87 |
return_full_text=False
|
|
|
|
| 22 |
|
| 23 |
# System-style instruction (non-medical, fixed headings)
|
| 24 |
system_prompt = (
|
| 25 |
+
"""Output MUST strictly follow this structured format:
|
| 26 |
+
|
| 27 |
+
1. Executive Summary
|
| 28 |
+
- Longevity Vitality Score (out of 100)
|
| 29 |
+
- Top Priority Issues
|
| 30 |
+
- Key Strengths
|
| 31 |
+
|
| 32 |
+
2. System-Specific Analysis
|
| 33 |
+
- Blood Health (MCV, RDW, Lymphocytes, WBC)
|
| 34 |
+
- Protein & Liver Health (Albumin, ALP)
|
| 35 |
+
- Kidney Health (Creatinine µmol/L)
|
| 36 |
+
- Metabolic Health (Glucose mmol/L, lnCRP)
|
| 37 |
+
- Other relevant systems
|
| 38 |
+
|
| 39 |
+
3. Personalized Action Plan
|
| 40 |
+
- Medical (tests/consults)
|
| 41 |
+
- Nutrition (diet & supplements)
|
| 42 |
+
- Lifestyle (hydration, exercise, sleep)
|
| 43 |
+
- Testing (follow-up labs: ferritin, Vitamin D, GGT)
|
| 44 |
+
|
| 45 |
+
4. Interaction Alerts
|
| 46 |
+
- How biomarkers interact (e.g., anemia ↔ infection cycle, ALP with bone/liver origin)
|
| 47 |
+
|
| 48 |
+
5. Longevity Metrics
|
| 49 |
+
- Metabolic Health Score
|
| 50 |
+
- Cardiovascular & Cognitive risk trajectory
|
| 51 |
+
|
| 52 |
+
. Enhanced AI Insights & Longitudinal Risk
|
| 53 |
+
|
|
|
|
| 54 |
"""
|
| 55 |
)
|
| 56 |
|
|
|
|
| 80 |
# Call LLM
|
| 81 |
result = pipe(
|
| 82 |
prompt,
|
|
|
|
| 83 |
do_sample=True,
|
| 84 |
temperature=0.6,
|
| 85 |
return_full_text=False
|