new server

This commit is contained in:
Saifeddine ALOUI 2024-02-21 01:09:31 +01:00
parent b8ed3581da
commit 7363a4bfdc
2 changed files with 4 additions and 3 deletions

View File

@ -104,7 +104,7 @@ class Service:
if not self.wait_for_service(1,False) and base_url is None:
ASCIIColors.info("Loading vllm service")
host, port = url2host_port(base_url)
_, host, port = url2host_port(base_url)
# run vllm
if platform.system() == 'Windows':
#subprocess.Popen(['wsl', 'ls', '$HOME'])

View File

@ -132,13 +132,14 @@ def url2host_port(url, default_port =8000):
if "http" in url:
parts = url.split(":")
host = ":".join(parts[:2])
host_no_http = parts[1].replace("//","")
port = url.split(":")[2] if len(parts)==3 else default_port
return host, port
return host, host_no_http, port
else:
parts = url.split(":")
host = parts[0]
port = url.split(":")[1] if len(parts)==2 else default_port
return host, port
return host, host, port
def is_asyncio_loop_running():
"""