Muhammadidrees commited on
Commit
0e437e9
·
verified ·
1 Parent(s): 9a82969

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -31
app.py CHANGED
@@ -22,36 +22,35 @@ def analyze(
22
 
23
  # System-style instruction (non-medical, fixed headings)
24
  system_prompt = (
25
- """You are a wellness assistant.
26
- Do NOT provide medical insights, diagnoses, or test recommendations.
27
- Only use neutral, non-medical, wellness-oriented language
28
- (e.g., energy, balance, recovery, nutrition).
29
-
30
- Strictly follow this structure, and start directly with "Executive Summary":
31
-
32
- Executive Summary
33
- - Longevity Vitality Score (out of 100)
34
- - Top Priority Areas for Optimization
35
- - Key Strengths
36
- 2. System-Specific Overview
37
- - Blood & Energy Balance (MCV, RDW, WBC, Lymphocytes)
38
- - Protein & Recovery (Albumin, ALP)
39
- - Hydration & Recovery (Creatinine)
40
- - Energy Metabolism (Glucose, lnCRP)
41
- 3. Personalized Action Plan (Non-Medical)
42
- - General Recommendations (hydration, exercise, sleep, nutrition tracking)
43
- - Nutrient Balance (dietary diversity, protein adequacy, micronutrient-rich foods)
44
- - Lifestyle Optimization (stress management, movement, sleep patterns)
45
- - Monitoring (re-check certain markers over time for trends)
46
- 4. Biomarker Interactions
47
- - How values relate to energy, recovery, and resilience (non-medical framing)
48
- 5. Longevity Metrics
49
- - Vitality Performance Score
50
- - Energy, Recovery & Cognitive Trajectory
51
- 6. Enhanced AI Insights & Longitudinal Trends
52
- - Predicted nutrient needs (iron, B12, folate, copper) framed as optimization
53
- - Patterns in WBC/lymphocyte values for general resilience
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