Clean up metrics code (#1972)
This commit is contained in:
@@ -391,8 +391,12 @@ class TokenizerManager:
|
||||
|
||||
async with self.model_update_lock:
|
||||
# wait for the previous generation requests to finish
|
||||
while len(self.rid_to_state) > 0:
|
||||
await asyncio.sleep(0.001)
|
||||
for i in range(3):
|
||||
while len(self.rid_to_state) > 0:
|
||||
await asyncio.sleep(0.001)
|
||||
# FIXME: We add some sleep here to avoid some race conditions.
|
||||
# We can use a read-write lock as a better fix.
|
||||
await asyncio.sleep(0.01)
|
||||
self.send_to_scheduler.send_pyobj(obj)
|
||||
self.model_update_result = asyncio.Future()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user