Skip to content

Commit

Permalink
Revert "server bench: fix bench not waiting for model load (ggerganov…
Browse files Browse the repository at this point in the history
…#7284)" (ggerganov#7334)

This reverts commit 583fd6b.
  • Loading branch information
phymbert authored and teleprint-me committed May 17, 2024
1 parent 99d5b28 commit 657f980
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions examples/server/bench/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,13 @@ def server_log(in_stream, out_stream):


def is_server_listening(server_fqdn, server_port):
try:
url = f"{server_fqdn}:{server_port}/health"
if not url.startswith("http://"):
url = f"http://{url}"
result = requests.get(url)
return result.status_code == 200
except Exception:
return False
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
result = sock.connect_ex((server_fqdn, server_port))
_is_server_listening = result == 0
if _is_server_listening:
print(f"server is listening on {server_fqdn}:{server_port}...")
return _is_server_listening


def escape_metric_name(metric_name):
return re.sub('[^A-Z0-9]', '_', metric_name.upper())
Expand Down

0 comments on commit 657f980

Please sign in to comment.