Bump the version to v0.1.8 (#93)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user