MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / add_data

Method add_data

tensorrt_llm/inputs/utils.py:499–511  ·  view source on GitHub ↗
(self,
                 media_type: str,
                 data: Union[Coroutine, Any],
                 *,
                 is_embedding: bool = False)

Source from the content-addressed store, hash-verified

497 return _retrieve(self._data), _retrieve(self._embeddings)
498
499 def add_data(self,
500 media_type: str,
501 data: Union[Coroutine, Any],
502 *,
503 is_embedding: bool = False):
504 current_count = len(self._data[media_type]) + len(
505 self._embeddings[media_type]) + 1
506 placeholder = retrieve_multimodal_placeholder(self._model_type,
507 media_type, current_count)
508 (self._embeddings
509 if is_embedding else self._data)[media_type].append(data)
510 if placeholder:
511 self._placeholder_counts[placeholder] += 1
512
513 def placeholder_counts(self) -> Dict[str, int]:
514 """Get the count of multimodal placeholders."""

Callers 3

apply_chat_templateMethod · 0.95

Calls 2

appendMethod · 0.45

Tested by

no test coverage detected