JohanBeytell commited on
Commit
b8bb432
·
verified ·
1 Parent(s): c1e158e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -53,11 +53,11 @@ def load_bioset_cccm():
53
  nn.Linear(in_features, len(LABELS))
54
  )
55
 
56
- # Cascade verification checks to capture either weight file formatting variant
57
  if os.path.exists('chestnet_efficientnet_weights.pth'):
58
  model.load_state_dict(torch.load('chestnet_efficientnet_weights.pth', map_location=device))
59
  elif os.path.exists('chestnet_efficientnet_full.pth'):
60
- checkpoint = torch.load('chestnet_efficientnet_full.pth', map_location=device)
61
  if hasattr(checkpoint, 'state_dict'):
62
  model.load_state_dict(checkpoint.state_dict())
63
  else:
@@ -121,9 +121,10 @@ saas_theme = gr.themes.Default(
121
  )
122
 
123
  # ==============================================================================
124
- # 4. COMPACT APP SURFACE DESIGN Layout
125
  # ==============================================================================
126
- with gr.Blocks(theme=saas_theme, title="Bioset CCCM Engine Deck") as demo:
 
127
 
128
  # Top Identity Brand Layer
129
  gr.Markdown(
@@ -150,11 +151,11 @@ with gr.Blocks(theme=saas_theme, title="Bioset CCCM Engine Deck") as demo:
150
  with gr.Column(scale=5):
151
  gr.Markdown("#### 📥 Tissue Ingestion & Alignment")
152
 
 
153
  input_image = gr.Image(
154
  label="Axial Pulmonary CT Slice Matrix Input",
155
  sources=["upload", "clipboard", "webcam"],
156
- type="numpy",
157
- tool="crop" # Enables high-fidelity crop, pan, and alignment controls on mobile + web
158
  )
159
 
160
  with gr.Row():
@@ -235,4 +236,5 @@ with gr.Blocks(theme=saas_theme, title="Bioset CCCM Engine Deck") as demo:
235
  )
236
 
237
  if __name__ == "__main__":
238
- demo.launch()
 
 
53
  nn.Linear(in_features, len(LABELS))
54
  )
55
 
56
+ # Cascade verification checks to capture either weight file formatting variant safely
57
  if os.path.exists('chestnet_efficientnet_weights.pth'):
58
  model.load_state_dict(torch.load('chestnet_efficientnet_weights.pth', map_location=device))
59
  elif os.path.exists('chestnet_efficientnet_full.pth'):
60
+ checkpoint = torch.load('chestnet_efficientnet_full.pth', map_location=device, weights_only=False)
61
  if hasattr(checkpoint, 'state_dict'):
62
  model.load_state_dict(checkpoint.state_dict())
63
  else:
 
121
  )
122
 
123
  # ==============================================================================
124
+ # 4. COMPACT APP SURFACE DESIGN
125
  # ==============================================================================
126
+ # FIXED: Theme parameter migrated to demo.launch() per Gradio specifications
127
+ with gr.Blocks(title="Bioset CCCM Engine Deck") as demo:
128
 
129
  # Top Identity Brand Layer
130
  gr.Markdown(
 
151
  with gr.Column(scale=5):
152
  gr.Markdown("#### 📥 Tissue Ingestion & Alignment")
153
 
154
+ # FIXED: Removed 'tool="crop"' since advanced tools are now active by default in Gradio
155
  input_image = gr.Image(
156
  label="Axial Pulmonary CT Slice Matrix Input",
157
  sources=["upload", "clipboard", "webcam"],
158
+ type="numpy"
 
159
  )
160
 
161
  with gr.Row():
 
236
  )
237
 
238
  if __name__ == "__main__":
239
+ # FIXED: Passed the custom SaaS theme token configuration parameter here inside launch()
240
+ demo.launch(theme=saas_theme)