Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion multimodal/dashinfer_vlm/api_server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def add_context_args(parser):
choices=["cuda"],
help="device (Default: cuda)",
)
group.add_argument("--max_length", type=int, default=32000, help="model max length")
group.add_argument("--max_length", type=int, default=128000, help="model max length")
group.add_argument("--max_batch", type=int, default=128, help="max batch")
group.add_argument(
"--parallel_size",
Expand Down
6 changes: 5 additions & 1 deletion multimodal/dashinfer_vlm/api_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,16 @@ def init():
context.set("tokenizer", tokenizer)
cuda_devices = [str(i) for i in range(tensor_parallel_size)]
compute_unit = "CUDA:" + ",".join(cuda_devices)
if hasattr(config, "max_position_embeddings"):
engine_max_len = min(config.max_position_embeddings, context.get("max_length"))
else:
engine_max_len = context.get("max_length")
# allspark model config
as_model_config = allspark.AsModelConfig(
model_name=model_name,
model_path=as_graph_path,
weights_path=as_weight_path,
engine_max_length=context.get("max_length"),
engine_max_length=engine_max_len,
engine_max_batch=context.get("max_batch"),
compute_unit=compute_unit,
enable_prefix_cache=True if context.get("enable_prefix_cache") else False,
Expand Down
4 changes: 2 additions & 2 deletions multimodal/dashinfer_vlm/vl_inference/runtime/qwen_vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ def __init__(
"QWEN2-AL": "audio_attention_mask",
"GUMMY-AL": "audio_attention_mask",
}
self.max_input_len = int(getenv("DS_LLM_MAX_IN_TOKENS", "20000"))
self.max_total_len = int(getenv("DS_LLM_MAX_TOKENS", "32000"))
self.max_total_len = as_config.engine_max_length
self.max_input_len = self.max_total_len - 1

"""
支持input_tokens格式:
Expand Down