@SofieVL Thanks it worked but with a bug. When I run the above lines of code, the app starts on the given port but with an error.
Starting the web server at http://localhost:9002 ...
Open the app in your browser and start annotating!
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-5-7d901ce6f128> in <module>
19 True,
20 None,
---> 21 port=port)
22
c:\users\45131968\scratchpad\.venv\lib\site-packages\prodigy\__init__.py in serve(command, *recipe_args, **config)
44 controller = loaded_recipe(*recipe_args)
45 controller.config.update(config)
---> 46 server(controller, controller.config)
c:\users\45131968\scratchpad\.venv\lib\site-packages\prodigy\app.py in server(controller, config)
510 port=int(port),
511 log_level=get_log_level(),
--> 512 log_config=_uvicorn_log_config,
513 )
514 controller.save()
c:\users\45131968\scratchpad\.venv\lib\site-packages\uvicorn\main.py in run(app, **kwargs)
352 supervisor.run()
353 else:
--> 354 server.run()
355
356
c:\users\45131968\scratchpad\.venv\lib\site-packages\uvicorn\main.py in run(self, sockets)
380 self.config.setup_event_loop()
381 loop = asyncio.get_event_loop()
--> 382 loop.run_until_complete(self.serve(sockets=sockets))
383
384 async def serve(self, sockets=None):
C:\ProgramData\Anaconda3\lib\asyncio\base_events.py in run_until_complete(self, future)
452 future.add_done_callback(_run_until_complete_cb)
453 try:
--> 454 self.run_forever()
455 except:
456 if new_task and future.done() and not future.cancelled():
C:\ProgramData\Anaconda3\lib\asyncio\base_events.py in run_forever(self)
406 self._check_closed()
407 if self.is_running():
--> 408 raise RuntimeError('This event loop is already running')
409 if events._get_running_loop() is not None:
410 raise RuntimeError(
RuntimeError: This event loop is already running
I checked the port, no event was running on it prior to running the above script.