mirror of
				https://github.com/allenai/olmocr.git
				synced 2025-10-31 18:15:44 +00:00 
			
		
		
		
	Fix
This commit is contained in:
		
							parent
							
								
									80ba562bb2
								
							
						
					
					
						commit
						748b095e0f
					
				| @ -564,8 +564,7 @@ async def sglang_server_task(args, semaphore): | |||||||
|         nonlocal last_running_req, last_queue_req, can_release_automatically, last_semaphore_release |         nonlocal last_running_req, last_queue_req, can_release_automatically, last_semaphore_release | ||||||
|         try: |         try: | ||||||
|             while True: |             while True: | ||||||
|                 await asyncio.sleep(1)  # Check every second |                 await asyncio.sleep(1) | ||||||
|                 logger.info(f"{last_queue_req}, {can_release_automatically}, {time.time() - last_semaphore_release}, {semaphore.locked()}") |  | ||||||
|                 if (last_queue_req == 0 and can_release_automatically and |                 if (last_queue_req == 0 and can_release_automatically and | ||||||
|                         time.time() - last_semaphore_release > 30 and semaphore.locked()): |                         time.time() - last_semaphore_release > 30 and semaphore.locked()): | ||||||
|                     semaphore.release() |                     semaphore.release() | ||||||
| @ -578,11 +577,11 @@ async def sglang_server_task(args, semaphore): | |||||||
|     # Start tasks to read stdout, stderr, and handle timeout logic |     # Start tasks to read stdout, stderr, and handle timeout logic | ||||||
|     stdout_task = asyncio.create_task(read_stream(proc.stdout)) |     stdout_task = asyncio.create_task(read_stream(proc.stdout)) | ||||||
|     stderr_task = asyncio.create_task(read_stream(proc.stderr)) |     stderr_task = asyncio.create_task(read_stream(proc.stderr)) | ||||||
|     timeout_task_future = asyncio.create_task(timeout_task()) |     timeout_task = asyncio.create_task(timeout_task()) | ||||||
| 
 | 
 | ||||||
|     await proc.wait() |     await proc.wait() | ||||||
|     timeout_task_future.cancel() |     timeout_task.cancel() | ||||||
|     await asyncio.gather(stdout_task, stderr_task, timeout_task_future, return_exceptions=True) |     await asyncio.gather(stdout_task, stderr_task, timeout_task, return_exceptions=True) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| async def sglang_server_host(args, semaphore): | async def sglang_server_host(args, semaphore): | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jake Poznanski
						Jake Poznanski