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

Bump the version to v0.1.8 (#93)

parent 489796c7
......@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "sglang"
version = "0.1.7"
version = "0.1.8"
description = "A structured generation langauge for LLMs."
readme = "README.md"
requires-python = ">=3.8"
......
__version__ = "0.1.7"
__version__ = "0.1.8"
from sglang.api import *
from sglang.global_config import global_config
......@@ -50,7 +50,9 @@ def init_global_processor(server_args: ServerArgs):
)
def get_pixel_values(image_data, image_aspect_ratio=None, image_grid_pinpoints=None, processor=None):
def get_pixel_values(
image_data, image_aspect_ratio=None, image_grid_pinpoints=None, processor=None
):
try:
processor = processor or global_processor
image = load_image(image_data)
......@@ -117,14 +119,22 @@ class TokenizerManager:
async def get_pixel_values(self, image_data):
aspect_ratio = getattr(self.hf_config, "image_aspect_ratio", None)
grid_pinpoints = self.hf_config.image_grid_pinpoints if aspect_ratio == "anyres" else None
grid_pinpoints = (
self.hf_config.image_grid_pinpoints if aspect_ratio == "anyres" else None
)
if self.executor is not None:
loop = asyncio.get_event_loop()
return await loop.run_in_executor(
self.executor, get_pixel_values, image_data, aspect_ratio, grid_pinpoints
self.executor,
get_pixel_values,
image_data,
aspect_ratio,
grid_pinpoints,
)
else:
return get_pixel_values(image_data, aspect_ratio, grid_pinpoints, self.processor)
return get_pixel_values(
image_data, aspect_ratio, grid_pinpoints, self.processor
)
async def generate_request(self, obj: GenerateReqInput):
if self.to_create_loop:
......
......@@ -380,12 +380,13 @@ def launch_server(server_args, pipe_finish_writer):
success = False
for i in range(60):
time.sleep(1)
try:
res = requests.get(url + "/get_model_info", timeout=5)
success = True
break
except requests.exceptions.RequestException as e:
time.sleep(1)
pass
if success:
pipe_finish_writer.send("init ok")
......@@ -406,7 +407,7 @@ class Runtime:
model_mode: List[str] = (),
schedule_heuristic: str = "lpm",
random_seed: int = 42,
log_level: str = "warning",
log_level: str = "error",
):
host = "127.0.0.1"
port = alloc_usable_network_port(1)[0]
......
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