Hali5 commited on
Commit
34fac49
·
1 Parent(s): 5ce8df3

Fixes to UI

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -27,6 +27,7 @@ model = Predictor(n_labels=len(LABELS))
27
 
28
  model_file = hf_hub_download(
29
  repo_id="Hali5/Mae-Model-MedMNIST-Predictor",
 
30
  filename="checkpoints/model_linear_v2_epoch_100.pt"
31
  )
32
 
@@ -88,7 +89,6 @@ with gradio.Blocks() as demo:
88
  with gradio.Tab("Examples"):
89
  gradio.Markdown("Click an example below to test the model against the PathMNIST test dataset.")
90
 
91
- # Create a read-only text box to display the column for Truth Labels
92
  with gradio.Column():
93
  input_img_ex = gradio.Image(label="Selected Test Image")
94
  truth_box = gradio.Textbox(label="Ground Truth Label", interactive=False)
@@ -97,8 +97,8 @@ with gradio.Blocks() as demo:
97
  output_lbl_ex = gradio.Label(num_top_classes=3, label="Model Prediction")
98
 
99
  gradio.Examples(
100
- examples=example_rows, # Passes both the image file path and the text label
101
- inputs=[input_img_ex, truth_box], # Maps the data columns to both UI components
102
  outputs=output_lbl_ex,
103
  fn=predict,
104
  cache_examples=True,
 
27
 
28
  model_file = hf_hub_download(
29
  repo_id="Hali5/Mae-Model-MedMNIST-Predictor",
30
+ # Create a read-only text box to display the column for Truth Labels
31
  filename="checkpoints/model_linear_v2_epoch_100.pt"
32
  )
33
 
 
89
  with gradio.Tab("Examples"):
90
  gradio.Markdown("Click an example below to test the model against the PathMNIST test dataset.")
91
 
 
92
  with gradio.Column():
93
  input_img_ex = gradio.Image(label="Selected Test Image")
94
  truth_box = gradio.Textbox(label="Ground Truth Label", interactive=False)
 
97
  output_lbl_ex = gradio.Label(num_top_classes=3, label="Model Prediction")
98
 
99
  gradio.Examples(
100
+ examples=example_rows,
101
+ inputs=[input_img_ex, truth_box],
102
  outputs=output_lbl_ex,
103
  fn=predict,
104
  cache_examples=True,