File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ async def server_step(self):
8383        self .is_server_running  =  True 
8484        updated_seq_groups  =  await  self .server .step .remote ()
8585        self .is_server_running  =  False 
86-         # Notify the waiting coroutines that there new outputs ready. 
86+         # Notify the waiting coroutines that there are  new outputs ready. 
8787        for  seq_group  in  updated_seq_groups :
8888            group_id  =  seq_group .group_id 
8989            self .running_seq_groups [group_id ] =  seq_group 
@@ -121,7 +121,10 @@ async def generate(self, request_dict: Dict):
121121            # Wait for new output. The group_event will be set in server_step 
122122            # when there is new output available for the sequence group. 
123123            # Added a timeout to prevent deadlock. 
124-             await  asyncio .wait_for (group_event .wait (), timeout = TIMEOUT_TO_PREVENT_DEADLOCK )
124+             try :
125+                 await  asyncio .wait_for (group_event .wait (), timeout = TIMEOUT_TO_PREVENT_DEADLOCK )
126+             except  asyncio .TimeoutError :
127+                 continue 
125128            # Reset the event to wait for the next output. 
126129            group_event .clear ()
127130            # Decode and return new outputs 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments