mirror of
https://github.com/allenai/olmocr.git
synced 2025-10-19 03:59:09 +00:00
Update suggested changes for qsize check
This commit is contained in:
parent
6d766307be
commit
ee687e25d6
@ -1049,7 +1049,9 @@ async def main():
|
|||||||
# Initialize the work queue
|
# Initialize the work queue
|
||||||
qsize = await work_queue.initialize_queue()
|
qsize = await work_queue.initialize_queue()
|
||||||
|
|
||||||
if qsize > 0:
|
if qsize == 0:
|
||||||
|
logger.info("No work to do, exiting")
|
||||||
|
return
|
||||||
# Create a semaphore to control worker access
|
# Create a semaphore to control worker access
|
||||||
# We only allow one worker to move forward with requests, until the server has no more requests in its queue
|
# We only allow one worker to move forward with requests, until the server has no more requests in its queue
|
||||||
# This lets us get full utilization by having many workers, but also to be outputting dolma docs as soon as possible
|
# This lets us get full utilization by having many workers, but also to be outputting dolma docs as soon as possible
|
||||||
@ -1077,8 +1079,6 @@ async def main():
|
|||||||
sglang_server.cancel()
|
sglang_server.cancel()
|
||||||
metrics_task.cancel()
|
metrics_task.cancel()
|
||||||
logger.info("Work done")
|
logger.info("Work done")
|
||||||
else:
|
|
||||||
logger.info("No work to do, exiting")
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user