Skip to content

Commit 7100389

Browse files
committed
reformat code
1 parent 240859f commit 7100389

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lightllm/server/router/model_infer/model_rpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ async def start_model_process(
256256
),
257257
)
258258
proc.start()
259-
259+
260260
# Use asyncio.to_thread to make the blocking wait non-blocking
261261
await asyncio.to_thread(success_event.wait, timeout=40)
262262
assert proc.is_alive()

lightllm/utils/tmp_utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from time import perf_counter
2+
from contextlib import contextmanager
3+
4+
5+
@contextmanager
6+
def timer(tag):
7+
t0 = perf_counter()
8+
try:
9+
yield
10+
finally:
11+
took_time = (perf_counter() - t0) * 1000
12+
print(f"[load-timer] {tag}: {took_time:.1f} ms", flush=True)

0 commit comments

Comments
 (0)