Unverified Commit 35ec2a45 authored by Lianmin Zheng's avatar Lianmin Zheng Committed by GitHub
Browse files

[minor] Remove deprecated function `get_ip` (#10883)

parent 0035f1ce
......@@ -2054,13 +2054,6 @@ def set_uvicorn_logging_configs():
LOGGING_CONFIG["formatters"]["access"]["datefmt"] = "%Y-%m-%d %H:%M:%S"
def get_ip() -> Optional[str]:
host_ip = os.getenv("SGLANG_HOST_IP", "") or os.getenv("HOST_IP", "")
if host_ip:
return host_ip
return None
def get_open_port() -> int:
port = os.getenv("SGLANG_PORT")
if port is not None:
......@@ -2400,8 +2393,10 @@ def get_local_ip_auto(fallback: str = None) -> str:
2. Network interface enumeration via get_local_ip_by_nic()
3. Remote connection method via get_local_ip_by_remote()
"""
if ip := get_ip():
return ip
# Try environment variable
host_ip = os.getenv("SGLANG_HOST_IP", "") or os.getenv("HOST_IP", "")
if host_ip:
return host_ip
logger.debug("get_ip failed")
# Fallback
if ip := get_local_ip_by_nic():
......
......@@ -2,7 +2,6 @@ from functools import lru_cache
from typing import Optional, Union
import torch
import torch.nn as nn
try:
from sgl_kernel import flash_ops
......
......@@ -51,10 +51,10 @@ def setup_class(cls, backend: str):
)
class TestJSONConstrainedOutlinesBackend(CustomTestCase):
class TestJSONConstrained(CustomTestCase):
@classmethod
def setUpClass(cls):
setup_class(cls, backend="outlines")
setup_class(cls, backend="xgrammar")
@classmethod
def tearDownClass(cls):
......@@ -137,13 +137,13 @@ class TestJSONConstrainedOutlinesBackend(CustomTestCase):
list(executor.map(self.run_decode, json_schemas))
class TestJSONConstrainedXGrammarBackend(TestJSONConstrainedOutlinesBackend):
class TestJSONConstrainedOutlinesBackend(TestJSONConstrained):
@classmethod
def setUpClass(cls):
setup_class(cls, backend="xgrammar")
setup_class(cls, backend="outlines")
class TestJSONConstrainedLLGuidanceBackend(TestJSONConstrainedOutlinesBackend):
class TestJSONConstrainedLLGuidanceBackend(TestJSONConstrained):
@classmethod
def setUpClass(cls):
setup_class(cls, backend="llguidance")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment