chore: add an unified server arg for multimodal inputs preprocess config(#12149)
Co-authored-by: bianfeng <bianfeng@pinduoduo.com> Co-authored-by: Xinyuan Tong <115166877+JustinTong0323@users.noreply.github.com>
This commit is contained in:
@@ -297,6 +297,7 @@ class ServerArgs:
|
||||
base_gpu_id: int = 0
|
||||
gpu_id_step: int = 1
|
||||
sleep_on_idle: bool = False
|
||||
mm_process_config: Optional[Dict[str, Any]] = None
|
||||
|
||||
# Logging
|
||||
log_level: str = "info"
|
||||
@@ -682,6 +683,8 @@ class ServerArgs:
|
||||
self.device = get_device()
|
||||
if self.random_seed is None:
|
||||
self.random_seed = random.randint(0, 1 << 30)
|
||||
if self.mm_process_config is None:
|
||||
self.mm_process_config = {}
|
||||
|
||||
def _handle_gpu_memory_settings(self, gpu_mem):
|
||||
"""
|
||||
@@ -2351,6 +2354,12 @@ class ServerArgs:
|
||||
action="store_true",
|
||||
help="Reduce CPU usage when sglang is idle.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--mm-process-config",
|
||||
type=json.loads,
|
||||
default=ServerArgs.mm_process_config,
|
||||
help="Multimodal preprocessing config, a json config contains keys: `image`, `video`, `audio`",
|
||||
)
|
||||
|
||||
# Logging
|
||||
parser.add_argument(
|
||||
|
||||
Reference in New Issue
Block a user