File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 3131 ANSI_RED ,
3232 ANSI_RESET ,
3333)
34+ import pkg_resources
3435
3536
3637# Load configuration
@@ -191,8 +192,11 @@ def call_gemini_pro_vision(messages, objective):
191192async def call_gpt_4_vision_preview_labeled (messages , objective ):
192193 time .sleep (1 )
193194 client = config .initialize_openai ()
195+
196+ # Construct the path to the file within the package
194197 try :
195- yolo_model = YOLO ("./operate/models/weights/best.pt" ) # Load your trained model
198+ file_path = pkg_resources .resource_filename ("operate.models.weights" , "best.pt" )
199+ yolo_model = YOLO (file_path ) # Load your trained model
196200 screenshots_dir = "screenshots"
197201 if not os .path .exists (screenshots_dir ):
198202 os .makedirs (screenshots_dir )
You can’t perform that action at this time.
0 commit comments