m7mdal7aj commited on
Commit
5331496
1 Parent(s): 42e3c91

Update my_model/tabs/run_inference.py

Browse files
Files changed (1) hide show
  1. my_model/tabs/run_inference.py +3 -22
my_model/tabs/run_inference.py CHANGED
@@ -103,21 +103,10 @@ class InferenceRunner(StateManager):
103
 
104
 
105
  def run_inference(self):
 
 
 
106
 
107
-
108
-
109
- if st.button("Re-run App"):
110
- trigger_rerun() # Force a re-run
111
- else:
112
- # Trigger re-run every 5 seconds (example)
113
- if time.time() - st.session_state.get("last_rerun", 0) > 5:
114
- trigger_rerun()
115
- st.session_state["last_rerun"] = time.time()
116
-
117
-
118
-
119
-
120
- self.set_up_widgets()
121
  load_fine_tuned_model = False
122
  fine_tuned_model_already_loaded = False
123
  reload_detection_model = False
@@ -189,11 +178,3 @@ class InferenceRunner(StateManager):
189
  self.image_qa_app(self.get_model())
190
  st.write('load success', 'loading in prog?', st.session_state['loading_in_progress'])
191
 
192
-
193
-
194
-
195
-
196
-
197
- @st.experimental_memo(show_spinner=False)
198
- def trigger_rerun():
199
- pass # No need for any specific code here
 
103
 
104
 
105
  def run_inference(self):
106
+ if st.session_state['loading_in_progress']:
107
+ st.rerun
108
+ self.set_up_widgets(rerun)
109
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  load_fine_tuned_model = False
111
  fine_tuned_model_already_loaded = False
112
  reload_detection_model = False
 
178
  self.image_qa_app(self.get_model())
179
  st.write('load success', 'loading in prog?', st.session_state['loading_in_progress'])
180