MCPcopy Index your code
hub / github.com/InternLM/lmdeploy / _is_new_preprocess_api

Method _is_new_preprocess_api

lmdeploy/vl/engine.py:101–107  ·  view source on GitHub ↗

New-style preprocess takes `input_prompt` + `mm_processor_kwargs`, legacy takes only `messages`.

(model)

Source from the content-addressed store, hash-verified

99
100 @staticmethod
101 def _is_new_preprocess_api(model) -> bool:
102 """New-style preprocess takes `input_prompt` + `mm_processor_kwargs`,
103 legacy takes only `messages`."""
104 if model is None:
105 return False
106 sig = inspect.signature(model.preprocess).parameters
107 return 'input_prompt' in sig and 'mm_processor_kwargs' in sig
108
109 async def preprocess(self,
110 messages: list[dict],

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected