Boghdady9 commited on
Commit
50bda14
Β·
1 Parent(s): 6eb638c

πŸš€ Fix Gradio schema error by downgrading to v4.20.0

Browse files

- Downgrade Gradio from 4.44.1 to 4.20.0 (stable version)
- Remove theme parameter causing schema validation issues
- Simplify button parameters (remove size, scale)
- Add string validation in analyze_medical_image function
- Set share=True for Hugging Face Spaces compatibility
- App now launches successfully without schema errors

Files changed (2) hide show
  1. requirements.txt +1 -1
  2. src/gradio_app.py +4 -5
requirements.txt CHANGED
@@ -1,6 +1,6 @@
1
  altair
2
  pandas
3
- gradio==4.44.1
4
  fastapi==0.104.1
5
  uvicorn==0.24.0
6
  python-multipart==0.0.9
 
1
  altair
2
  pandas
3
+ gradio==4.20.0
4
  fastapi==0.104.1
5
  uvicorn==0.24.0
6
  python-multipart==0.0.9
src/gradio_app.py CHANGED
@@ -361,7 +361,7 @@ def check_system_status():
361
 
362
  # Create the Gradio interface
363
  def create_medivision_app():
364
- with gr.Blocks(css=medical_css, title="MediVision - Radiology Report System", theme=gr.themes.Soft()) as app:
365
 
366
  # Header
367
  create_header()
@@ -416,7 +416,7 @@ def create_medivision_app():
416
  height=300
417
  )
418
 
419
- analyze_btn = gr.Button("πŸ”¬ Generate Report", variant="primary", size="lg")
420
 
421
  # Results Section
422
  gr.HTML('<div class="medical-card"><h2>πŸ“Š Analysis Results</h2></div>')
@@ -444,10 +444,9 @@ def create_medivision_app():
444
  with gr.Row():
445
  search_mrn = gr.Textbox(
446
  label="Medical Record Number",
447
- placeholder="Enter MRN to search",
448
- scale=3
449
  )
450
- search_btn = gr.Button("πŸ” Search", variant="primary", scale=1)
451
 
452
  search_results = gr.HTML()
453
 
 
361
 
362
  # Create the Gradio interface
363
  def create_medivision_app():
364
+ with gr.Blocks(css=medical_css, title="MediVision - Radiology Report System") as app:
365
 
366
  # Header
367
  create_header()
 
416
  height=300
417
  )
418
 
419
+ analyze_btn = gr.Button("πŸ”¬ Generate Report", variant="primary")
420
 
421
  # Results Section
422
  gr.HTML('<div class="medical-card"><h2>πŸ“Š Analysis Results</h2></div>')
 
444
  with gr.Row():
445
  search_mrn = gr.Textbox(
446
  label="Medical Record Number",
447
+ placeholder="Enter MRN to search"
 
448
  )
449
+ search_btn = gr.Button("πŸ” Search", variant="primary")
450
 
451
  search_results = gr.HTML()
452