Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def start_server(args):
while time.time() - start < SERVER_TIMEOUT:
if process.poll() is not None:
log_file.flush()
log_file.close()
raise RuntimeError(f"SGLang server exited early. Check {args.server_log}")
if server_ready(SERVER_URL):
print(f"Server ready ({time.time() - start:.0f}s)")
Expand Down Expand Up @@ -212,6 +213,7 @@ def infer_one(image_path: str, output_file: str | None, args, idx: int) -> dict:
stream=True,
)
if resp.status_code == 502 and attempt < MAX_RETRIES - 1:
resp.close()
time.sleep(3 * (attempt + 1))
continue
resp.raise_for_status()
Expand Down