m7mdal7aj commited on
Commit
dd1c5c5
1 Parent(s): d9364fd

Update my_model/tabs/run_inference.py

Browse files
Files changed (1) hide show
  1. my_model/tabs/run_inference.py +2 -2
my_model/tabs/run_inference.py CHANGED
@@ -13,7 +13,6 @@ from my_model.gen_utilities import free_gpu_resources
13
  from my_model.KBVQA import KBVQA, prepare_kbvqa_model
14
  from my_model.utilities.state_manager import StateManager
15
 
16
- global state_manager
17
  state_manager = StateManager()
18
 
19
  def answer_question(caption, detected_objects_str, question, model):
@@ -96,9 +95,10 @@ def process_new_image(image_key, image, kbvqa):
96
 
97
  def run_inference():
98
 
99
-
100
  st.title("Run Inference")
101
 
 
 
102
  st.selectbox("Choose a method:", ["Fine-Tuned Model", "In-Context Learning (n-shots)"], index=0, key='method')
103
  st.selectbox("Choose a model for objects detection:", ["yolov5", "detic"], index=1, key='detection_model')
104
  default_confidence = 0.2 if st.session_state['detection_model'] == "yolov5" else 0.4
 
13
  from my_model.KBVQA import KBVQA, prepare_kbvqa_model
14
  from my_model.utilities.state_manager import StateManager
15
 
 
16
  state_manager = StateManager()
17
 
18
  def answer_question(caption, detected_objects_str, question, model):
 
95
 
96
  def run_inference():
97
 
 
98
  st.title("Run Inference")
99
 
100
+ state_manager.initialize_state()
101
+
102
  st.selectbox("Choose a method:", ["Fine-Tuned Model", "In-Context Learning (n-shots)"], index=0, key='method')
103
  st.selectbox("Choose a model for objects detection:", ["yolov5", "detic"], index=1, key='detection_model')
104
  default_confidence = 0.2 if st.session_state['detection_model'] == "yolov5" else 0.4