Skip to content

Commit eb4514a

Browse files
committed
Temporary Fix for #383
1 parent 1987422 commit eb4514a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

olmocr/pipeline.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,11 @@ async def worker(args, work_queue: WorkQueue, semaphore, worker_id):
626626
await work_queue.mark_done(work_item)
627627
except Exception as e:
628628
logger.exception(f"Exception occurred while processing work_hash {work_item.hash}: {e}")
629-
629+
finally:
630+
# Temporary fix for https://github.com/allenai/olmocr/issues/383, for now we will just release the sempahore
631+
# as each worker finishes, so that the process can quit in the end.
632+
if args.server:
633+
semaphore.release()
630634

631635
async def vllm_server_task(model_name_or_path, args, semaphore, unknown_args=None):
632636
cmd = [

0 commit comments

Comments
 (0)