[Docs] optimize and supplement docs system (#86)
Signed-off-by: Gaohan123 <gaohan19@huawei.com>
This commit is contained in:
1 parent
38f58064eb
commit
db81ee9f69
75 files changed
+2452
-512
No files matched your search
@@ -11,6 +11,17 @@ from vllm.inputs.data import EmbedsPrompt, TokenInputs, TokensPrompt
|
||||
|
||||
|
||||
class OmniTokensPrompt(TokensPrompt):
|
||||
"""Tokens prompt with optional embeddings and additional information.
|
||||
|
||||
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
|
||||
"""
|
||||
|
||||
prompt_embeds: NotRequired[torch.Tensor]
|
||||
"""The embeddings of the prompt."""
|
||||
|
||||
@@ -20,6 +31,18 @@ class OmniTokensPrompt(TokensPrompt):
|
||||
|
||||
|
||||
class OmniTokenInputs(TokenInputs):
|
||||
"""Token inputs with optional embeddings and additional information.
|
||||
|
||||
Extends TokenInputs to support prompt embeddings and additional
|
||||
information payloads for direct transfer between pipeline stages.
|
||||
|
||||
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
|
||||
"""
|
||||
|
||||
# New: optional prompt embeddings aligned with token ids
|
||||
prompt_embeds: NotRequired[torch.Tensor]
|
||||
|
||||
@@ -29,6 +52,17 @@ class OmniTokenInputs(TokenInputs):
|
||||
|
||||
|
||||
class OmniEmbedsPrompt(EmbedsPrompt):
|
||||
"""Embeddings prompt with optional additional information.
|
||||
|
||||
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
|
||||
"""
|
||||
|
||||
# New: optional prompt embeddings aligned with token ids
|
||||
prompt_embeds: NotRequired[torch.Tensor]
|
||||
|
||||
@@ -44,7 +78,22 @@ def token_inputs_omni(
|
||||
prompt_embeds: Optional[torch.Tensor] = None,
|
||||
additional_information: Optional[dict[str, Any]] = None,
|
||||
) -> OmniTokenInputs:
|
||||
"""Construct token inputs with optional embeddings and metadata."""
|
||||
"""Construct token inputs with optional embeddings and metadata.
|
||||
|
||||
Creates an OmniTokenInputs object with token IDs and optional
|
||||
embeddings and additional information for pipeline stage transfer.
|
||||
|
||||
Args:
|
||||
prompt_token_ids: List of token IDs for the prompt
|
||||
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)
|
||||
|
||||
Returns:
|
||||
OmniTokenInputs instance with the provided data
|
||||
"""
|
||||
inputs = OmniTokenInputs(type="token", prompt_token_ids=prompt_token_ids)
|
||||
|
||||
if prompt is not None:
|
||||
|
||||
Reference in new issue
Block a user