hssling commited on
Commit
5dd7eca
·
1 Parent(s): d8aef83

Strengthen ECG prompt to avoid generic refusal outputs

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -76,8 +76,17 @@ def diagnose_ecg(image: Image.Image = None, temp: float = 0.4, max_tokens: int =
76
  if image is None:
77
  return json.dumps({"error": "No image provided."})
78
 
79
- system_prompt = "You are CardioAI, a highly advanced expert Cardiologist. Analyze the provided Electrocardiogram (ECG/EKG)."
80
- user_prompt = "Analyze this 12-lead Electrocardiogram trace and extract the detailed clinical rhythms and pathological findings in a structured format."
 
 
 
 
 
 
 
 
 
81
 
82
  messages = [
83
  {"role": "system", "content": system_prompt},
 
76
  if image is None:
77
  return json.dumps({"error": "No image provided."})
78
 
79
+ system_prompt = (
80
+ "You are CardioAI, an ECG interpretation engine. "
81
+ "Always analyze the provided ECG image directly. "
82
+ "Do not provide generic AI disclaimers. "
83
+ "Return concise clinical content only."
84
+ )
85
+ user_prompt = (
86
+ "Interpret this ECG image and return exactly these sections: "
87
+ "1) Impression, 2) Rhythm, 3) Rate, 4) ST-T Findings, 5) Urgency. "
88
+ "If image quality is insufficient, write 'Non-diagnostic ECG image quality' in Impression."
89
+ )
90
 
91
  messages = [
92
  {"role": "system", "content": system_prompt},