ShawnRu commited on
Commit
99dd437
·
verified ·
1 Parent(s): ebc8d14

Update src/webui.py

Browse files
Files changed (1) hide show
  1. src/webui.py +6 -16
src/webui.py CHANGED
@@ -78,19 +78,9 @@ examples = [
78
  "text": "",
79
  "update_case": False,
80
  "truth": "",
81
- },
82
- {
83
- "task": "Base",
84
- "mode": "quick",
85
- "use_file": False,
86
- "text": "John Smith, a 45-year-old male, presents with persistent headaches that have lasted for the past 10 days. The headaches are described as moderate and occur primarily in the frontal region, often accompanied by mild nausea. The patient reports no significant medical history except for seasonal allergies, for which he occasionally takes antihistamines. Physical examination reveals a heart rate of 78 beats per minute, blood pressure of 125/80 mmHg, and normal temperature. A neurological examination showed no focal deficits. A CT scan of the head was performed, which revealed no acute abnormalities, and a sinus X-ray suggested mild sinusitis. Based on the clinical presentation and imaging results, the diagnosis is sinusitis, and the patient is advised to take decongestants and rest for recovery.",
87
- "instruction": "Please extract the key medical information from this case description.",
88
- "constraint": "",
89
- "file_path": None,
90
- "update_case": False,
91
- "truth": "",
92
  }
93
  ]
 
94
 
95
 
96
  def create_interface():
@@ -217,12 +207,12 @@ def create_interface():
217
  # else:
218
  # return gr.update(visible=False)
219
 
220
- idx = 0
221
  def start_with_example():
222
- example = examples[idx]
223
- idx += 1
224
- if idx >= len(examples):
225
- idx = 0
 
226
 
227
  return (
228
  gr.update(value=example["task"]),
 
78
  "text": "",
79
  "update_case": False,
80
  "truth": "",
 
 
 
 
 
 
 
 
 
 
 
81
  }
82
  ]
83
+ example_start_index = 0
84
 
85
 
86
  def create_interface():
 
207
  # else:
208
  # return gr.update(visible=False)
209
 
 
210
  def start_with_example():
211
+ global example_start_index
212
+ example = examples[example_start_index]
213
+ example_start_index += 1
214
+ if example_start_index >= len(examples):
215
+ example_start_index = 0
216
 
217
  return (
218
  gr.update(value=example["task"]),