[Docs] Replace rst style double-backtick with md single-backtick (#27091)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2025-10-17 10:47:34 +01:00
committed by GitHub
parent 483ea64611
commit 6c9fdbf725
31 changed files with 98 additions and 98 deletions

View File

@@ -99,13 +99,13 @@ class AutoWeightsLoader:
the weights only once.
The weight loading logic for individual modules can be overridden
by defining a ``load_weights`` method.
by defining a `load_weights` method.
Similarly, the weight loading logic for individual parameters can be
overridden by defining a ``weight_loader`` method.
overridden by defining a `weight_loader` method.
Detailed weight loading information can be viewed by setting the
environment variable ``VLLM_LOGGING_LEVEL=DEBUG``.
environment variable `VLLM_LOGGING_LEVEL=DEBUG`.
"""
# Models trained using early version ColossalAI
@@ -372,9 +372,9 @@ def flatten_bn(
concat: bool = False,
) -> list[torch.Tensor] | torch.Tensor:
"""
Flatten the ``B`` and ``N`` dimensions of batched multimodal inputs.
Flatten the `B` and `N` dimensions of batched multimodal inputs.
The input tensor should have shape ``(B, N, ...)```.
The input tensor should have shape `(B, N, ...)`.
"""
if isinstance(x, torch.Tensor):
return x.flatten(0, 1)
@@ -424,12 +424,12 @@ def _merge_multimodal_embeddings(
is_multimodal: torch.Tensor,
) -> torch.Tensor:
"""
Merge ``multimodal_embeddings`` into ``inputs_embeds`` by overwriting the
positions in ``inputs_embeds`` corresponding to placeholder tokens in
``input_ids``.
Merge `multimodal_embeddings` into `inputs_embeds` by overwriting the
positions in `inputs_embeds` corresponding to placeholder tokens in
`input_ids`.
Note:
This updates ``inputs_embeds`` in place.
This updates `inputs_embeds` in place.
"""
if len(multimodal_embeddings) == 0:
return inputs_embeds
@@ -475,14 +475,14 @@ def merge_multimodal_embeddings(
placeholder_token_id: int | list[int],
) -> torch.Tensor:
"""
Merge ``multimodal_embeddings`` into ``inputs_embeds`` by overwriting the
positions in ``inputs_embeds`` corresponding to placeholder tokens in
``input_ids``.
Merge `multimodal_embeddings` into `inputs_embeds` by overwriting the
positions in `inputs_embeds` corresponding to placeholder tokens in
`input_ids`.
``placeholder_token_id`` can be a list of token ids (e.g, token ids
`placeholder_token_id` can be a list of token ids (e.g, token ids
of img_start, img_break, and img_end tokens) when needed: This means
the order of these tokens in the ``input_ids`` MUST MATCH the order of
their embeddings in ``multimodal_embeddings`` since we need to
the order of these tokens in the `input_ids` MUST MATCH the order of
their embeddings in `multimodal_embeddings` since we need to
slice-merge instead of individually scattering.
For example, if input_ids is "TTTTTSIIIBIIIBIIIETTT", where
@@ -497,7 +497,7 @@ def merge_multimodal_embeddings(
input_ids for a correct embedding merge.
Note:
This updates ``inputs_embeds`` in place.
This updates `inputs_embeds` in place.
"""
if isinstance(placeholder_token_id, list):
is_multimodal = isin_list(input_ids, placeholder_token_id)