pdarleyjr commited on
Commit
52bab4e
·
1 Parent(s): 972a229

Updated app.py with modern Gradio features and README.md with correct SDK version

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +23 -12
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🏥
4
  colorFrom: purple
5
  colorTo: blue
6
  sdk: gradio
7
- sdk_version: 4.12.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
4
  colorFrom: purple
5
  colorTo: blue
6
  sdk: gradio
7
+ sdk_version: 5.13.2
8
  app_file: app.py
9
  pinned: false
10
  license: mit
app.py CHANGED
@@ -27,24 +27,35 @@ def generate_clinical_report(input_text):
27
  # Decode and return the generated report
28
  return tokenizer.decode(outputs[0], skip_special_tokens=True)
29
 
30
- # Create Gradio interface
31
  demo = gr.Interface(
32
  fn=generate_clinical_report,
33
- inputs=gr.Textbox(
34
- lines=8,
35
- placeholder="Enter clinical notes here...",
36
- label="Clinical Notes"
37
- ),
38
- outputs=gr.Textbox(
39
- lines=8,
40
- label="Generated Clinical Report"
41
- ),
 
 
 
 
 
 
42
  title="Clinical Report Generator",
43
- description="Generate professional clinical reports from clinical notes using a fine-tuned T5 model.",
44
  examples=[
45
  ["Patient presented with severe abdominal pain in the lower right quadrant. Temperature 38.5°C, BP 130/85."],
46
  ["Follow-up visit for diabetes management. Blood sugar levels have been stable with current medication regimen."]
47
- ]
 
 
 
 
 
48
  )
49
 
50
  # Launch the app
 
27
  # Decode and return the generated report
28
  return tokenizer.decode(outputs[0], skip_special_tokens=True)
29
 
30
+ # Create Gradio interface with updated styling
31
  demo = gr.Interface(
32
  fn=generate_clinical_report,
33
+ inputs=[
34
+ gr.Textbox(
35
+ lines=8,
36
+ placeholder="Enter clinical notes here...",
37
+ label="Clinical Notes",
38
+ elem_id="input-box"
39
+ )
40
+ ],
41
+ outputs=[
42
+ gr.Textbox(
43
+ lines=8,
44
+ label="Generated Clinical Report",
45
+ elem_id="output-box"
46
+ )
47
+ ],
48
  title="Clinical Report Generator",
49
+ description="Generate professional clinical reports from clinical notes using a T5 model.",
50
  examples=[
51
  ["Patient presented with severe abdominal pain in the lower right quadrant. Temperature 38.5°C, BP 130/85."],
52
  ["Follow-up visit for diabetes management. Blood sugar levels have been stable with current medication regimen."]
53
+ ],
54
+ theme=gr.themes.Soft(),
55
+ css="""
56
+ #input-box { background-color: #f6f6f6; }
57
+ #output-box { background-color: #f0f7ff; }
58
+ """
59
  )
60
 
61
  # Launch the app