kernel-luso-comfort commited on
Commit
fa26a4b
·
1 Parent(s): 287d863

Update mock model imports and enhance demo interface in development mode

Browse files
inference_utils/{init_predict_dev.py → init_predict_mock.py} RENAMED
File without changes
main.py CHANGED
@@ -18,7 +18,7 @@ DEV_MODE = True if os.getenv("DEV_MODE") else False
18
  import gradio as gr
19
 
20
  if DEV_MODE:
21
- from inference_utils.init_predict_dev import init_model, predict
22
  else:
23
  from inference_utils.init_predict import init_model, predict
24
 
@@ -27,7 +27,7 @@ gr.set_static_paths(["assets"])
27
 
28
 
29
  def run():
30
- global model, demo
31
  model = init_model()
32
 
33
  demo = gr.Interface(
@@ -70,6 +70,7 @@ def run():
70
  ["examples/TCGA_HT_7856_19950831_8_MRI-FLAIR_brain.png", "glioma"],
71
  ],
72
  )
 
73
 
74
 
75
  description = """Upload a biomedical image and enter prompts (separated by commas) to detect specific features.
@@ -95,6 +96,7 @@ This Space is based on the [BiomedParse model](https://microsoft.github.io/Biome
95
  """
96
 
97
 
 
 
98
  if __name__ == "__main__":
99
- run()
100
  demo.launch(server_name="0.0.0.0", server_port=7860)
 
18
  import gradio as gr
19
 
20
  if DEV_MODE:
21
+ from inference_utils.init_predict_mock import init_model, predict
22
  else:
23
  from inference_utils.init_predict import init_model, predict
24
 
 
27
 
28
 
29
  def run():
30
+ global model
31
  model = init_model()
32
 
33
  demo = gr.Interface(
 
70
  ["examples/TCGA_HT_7856_19950831_8_MRI-FLAIR_brain.png", "glioma"],
71
  ],
72
  )
73
+ return demo
74
 
75
 
76
  description = """Upload a biomedical image and enter prompts (separated by commas) to detect specific features.
 
96
  """
97
 
98
 
99
+ demo = run()
100
+
101
  if __name__ == "__main__":
 
102
  demo.launch(server_name="0.0.0.0", server_port=7860)