[Full Duplex] Feat: Support Full-Duplex realtime runtime & add MiniCPM-o 4.5 demo (#3907)
Signed-off-by: Sy03 <1370724210@qq.com> Signed-off-by: lishunyang12 <lishunyang03@gmail.com> Signed-off-by: Yueqian Lin <linyueqian@outlook.com> Co-authored-by: lishunyang12 <lishunyang03@gmail.com> Co-authored-by: Yueqian Lin <linyueqian@outlook.com> Co-authored-by: StormMelody <22371184@zju.edu.cn> Co-authored-by: Gao Han <hgaoaf@connect.ust.hk> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
142 files changed
+48389
-1013
No files matched your search
+26
-14
@@ -21,15 +21,16 @@ from vllm.inputs.engine import TokensInput
|
||||
|
||||
|
||||
class OmniTextPrompt(TextPrompt):
|
||||
"""Text prompt with optional embeddings and additional information.
|
||||
"""Text prompt with optional embeddings and stage payloads.
|
||||
|
||||
Extends TextPrompt to support prompt embeddings and additional
|
||||
information payloads for direct transfer between pipeline stages.
|
||||
|
||||
Attributes:
|
||||
prompt_embeds: Optional tensor containing prompt embeddings
|
||||
additional_information: Optional dictionary containing additional
|
||||
information (tensors or lists) to pass along with the prompt
|
||||
additional_information: Legacy optional dictionary containing
|
||||
additional information to pass along with the prompt.
|
||||
model_intermediate_buffer: Optional runner-owned stage payload.
|
||||
"""
|
||||
|
||||
negative_prompt: NotRequired[str]
|
||||
@@ -39,18 +40,20 @@ class OmniTextPrompt(TextPrompt):
|
||||
prompt_embeds: NotRequired[torch.Tensor]
|
||||
negative_prompt_embeds: NotRequired[torch.Tensor]
|
||||
additional_information: NotRequired[dict[str, Any]]
|
||||
model_intermediate_buffer: NotRequired[dict[str, Any]]
|
||||
|
||||
|
||||
class OmniTokensPrompt(TokensPrompt):
|
||||
"""Tokens prompt with optional embeddings and additional information.
|
||||
"""Tokens prompt with optional embeddings and stage payloads.
|
||||
|
||||
Extends TokensPrompt to support prompt embeddings and additional
|
||||
information payloads for direct transfer between pipeline stages.
|
||||
|
||||
Attributes:
|
||||
prompt_embeds: Optional tensor containing prompt embeddings
|
||||
additional_information: Optional dictionary containing additional
|
||||
information (tensors or lists) to pass along with the prompt
|
||||
additional_information: Legacy optional dictionary containing
|
||||
additional information to pass along with the prompt.
|
||||
model_intermediate_buffer: Optional runner-owned stage payload.
|
||||
"""
|
||||
|
||||
negative_prompt: NotRequired[str]
|
||||
@@ -61,10 +64,11 @@ class OmniTokensPrompt(TokensPrompt):
|
||||
# New: optional additional information dictionary
|
||||
# Values may be torch.Tensor or list
|
||||
additional_information: NotRequired[dict[str, Any]]
|
||||
model_intermediate_buffer: NotRequired[dict[str, Any]]
|
||||
|
||||
|
||||
class OmniTokenInputs(TokensInput):
|
||||
"""Token inputs with optional embeddings and additional information.
|
||||
"""Token inputs with optional embeddings and stage payloads.
|
||||
|
||||
Extends TokensInput to support prompt embeddings and additional
|
||||
information payloads for direct transfer between pipeline stages.
|
||||
@@ -72,8 +76,9 @@ class OmniTokenInputs(TokensInput):
|
||||
Attributes:
|
||||
prompt_embeds: Optional tensor containing prompt embeddings
|
||||
aligned with token IDs
|
||||
additional_information: Optional dictionary containing additional
|
||||
information (tensors or lists) to pass along with the inputs
|
||||
additional_information: Legacy optional dictionary containing
|
||||
additional information to pass along with the inputs.
|
||||
model_intermediate_buffer: Optional runner-owned stage payload.
|
||||
"""
|
||||
|
||||
# New: optional prompt embeddings aligned with token ids
|
||||
@@ -84,18 +89,20 @@ class OmniTokenInputs(TokensInput):
|
||||
# New: optional additional information dictionary
|
||||
# Values may be torch.Tensor or list
|
||||
additional_information: NotRequired[dict[str, Any]]
|
||||
model_intermediate_buffer: NotRequired[dict[str, Any]]
|
||||
|
||||
|
||||
class OmniEmbedsPrompt(EmbedsPrompt):
|
||||
"""Embeddings prompt with optional additional information.
|
||||
"""Embeddings prompt with optional stage payloads.
|
||||
|
||||
Extends EmbedsPrompt to support additional information payloads
|
||||
for direct transfer between pipeline stages.
|
||||
|
||||
Attributes:
|
||||
prompt_embeds: Optional tensor containing prompt embeddings
|
||||
additional_information: Optional dictionary containing additional
|
||||
information (tensors or lists) to pass along with the prompt
|
||||
additional_information: Legacy optional dictionary containing
|
||||
additional information to pass along with the prompt.
|
||||
model_intermediate_buffer: Optional runner-owned stage payload.
|
||||
"""
|
||||
|
||||
# New: optional prompt embeddings aligned with token ids
|
||||
@@ -105,6 +112,7 @@ class OmniEmbedsPrompt(EmbedsPrompt):
|
||||
# New: optional additional information dictionary
|
||||
# Values may be torch.Tensor or list
|
||||
additional_information: NotRequired[dict[str, Any]]
|
||||
model_intermediate_buffer: NotRequired[dict[str, Any]]
|
||||
|
||||
|
||||
class OmniCustomPrompt(TypedDict, total=False):
|
||||
@@ -143,6 +151,7 @@ def token_inputs_omni(
|
||||
cache_salt: str | None = None,
|
||||
prompt_embeds: torch.Tensor | None = None,
|
||||
additional_information: dict[str, Any] | None = None,
|
||||
model_intermediate_buffer: dict[str, Any] | None = None,
|
||||
) -> OmniTokenInputs:
|
||||
"""Construct token inputs with optional embeddings and metadata.
|
||||
|
||||
@@ -154,8 +163,9 @@ def token_inputs_omni(
|
||||
prompt: Optional prompt string
|
||||
cache_salt: Optional cache salt for prefix caching
|
||||
prompt_embeds: Optional tensor containing prompt embeddings
|
||||
additional_information: Optional dictionary containing additional
|
||||
information (tensors or lists)
|
||||
additional_information: Legacy optional dictionary containing
|
||||
additional information (tensors or lists).
|
||||
model_intermediate_buffer: Optional runner-owned stage payload.
|
||||
|
||||
Returns:
|
||||
OmniTokenInputs instance with the provided data
|
||||
@@ -170,6 +180,8 @@ def token_inputs_omni(
|
||||
inputs["prompt_embeds"] = prompt_embeds
|
||||
if additional_information is not None:
|
||||
inputs["additional_information"] = additional_information
|
||||
if model_intermediate_buffer is not None:
|
||||
inputs["model_intermediate_buffer"] = model_intermediate_buffer
|
||||
|
||||
return inputs
|
||||
|
||||
|
||||
Reference in new issue
Block a user