pymllm.engine.io_struct ======================= .. py:module:: pymllm.engine.io_struct Classes ------- .. autoapisummary:: pymllm.engine.io_struct.BaseReq pymllm.engine.io_struct.BaseBatchReq pymllm.engine.io_struct.GenerateReqInput pymllm.engine.io_struct.TokenizedGenerateReqInput pymllm.engine.io_struct.BatchTokenizedGenerateReqInput pymllm.engine.io_struct.BatchTokenIDOutput pymllm.engine.io_struct.BatchStrOutput Module Contents --------------- .. py:class:: BaseReq .. py:attribute:: rid :type: Optional[Union[str, List[str]]] :value: None .. py:method:: regenerate_rid() .. py:class:: BaseBatchReq .. py:attribute:: rids :type: List[str] .. py:method:: regenerate_rids() .. py:class:: GenerateReqInput Bases: :py:obj:`BaseReq` .. py:attribute:: text :type: Optional[Union[List[str], str]] :value: None .. py:attribute:: input_ids :type: Optional[Union[List[List[int]], List[int]]] :value: None .. py:attribute:: sampling_params :type: Optional[Union[List[Dict[str, Any]], Dict[str, Any]]] :value: None .. py:attribute:: return_logprob :type: Optional[Union[List[bool], bool]] :value: None .. py:attribute:: logprob_start_len :type: Optional[Union[List[int], int]] :value: None .. py:attribute:: top_logprobs_num :type: Optional[Union[List[int], int]] :value: None .. py:attribute:: stream :type: bool :value: False .. py:attribute:: image_data :type: Optional[Any] :value: None .. py:attribute:: video_data :type: Optional[Any] :value: None .. py:attribute:: audio_data :type: Optional[Any] :value: None .. py:attribute:: lora_path :type: Optional[Union[List[Optional[str]], str]] :value: None .. py:attribute:: session_params :type: Optional[Union[List[Dict[str, Any]], Dict[str, Any]]] :value: None .. py:attribute:: extra_options :type: Dict[str, Any] .. py:attribute:: is_single :type: bool :value: True .. py:attribute:: batch_size :type: int :value: 1 .. py:method:: normalize_batch_and_arguments() .. py:method:: __getitem__(i) .. py:method:: to_request_dict() .. py:class:: TokenizedGenerateReqInput Bases: :py:obj:`BaseReq` .. py:attribute:: input_text :type: str :value: '' .. py:attribute:: input_ids :type: List[int] :value: [] .. py:attribute:: mm_inputs :type: Optional[Dict[str, Any]] :value: None .. py:attribute:: sampling_params :type: Dict[str, Any] .. py:attribute:: stream :type: bool :value: False .. py:attribute:: return_logprob :type: bool :value: False .. py:attribute:: logprob_start_len :type: int :value: -1 .. py:attribute:: top_logprobs_num :type: int :value: 0 .. py:attribute:: lora_path :type: Optional[str] :value: None .. py:attribute:: session_params :type: Optional[Dict[str, Any]] :value: None .. py:class:: BatchTokenizedGenerateReqInput Bases: :py:obj:`BaseBatchReq` .. py:attribute:: reqs :type: List[TokenizedGenerateReqInput] .. py:method:: __len__() .. py:method:: __getitem__(i) .. py:method:: __iter__() .. py:class:: BatchTokenIDOutput Bases: :py:obj:`BaseBatchReq` .. py:attribute:: finished_reasons :type: List[Optional[str]] .. py:attribute:: decode_ids :type: List[int] .. py:attribute:: read_offsets :type: List[int] .. py:attribute:: output_ids :type: Optional[List[int]] .. py:attribute:: skip_special_tokens :type: List[bool] .. py:attribute:: prompt_tokens :type: List[int] .. py:attribute:: completion_tokens :type: List[int] .. py:attribute:: input_token_logprobs_val :type: List[float] :value: [] .. py:attribute:: input_token_logprobs_idx :type: List[int] :value: [] .. py:attribute:: output_token_logprobs_val :type: List[float] :value: [] .. py:attribute:: output_token_logprobs_idx :type: List[int] :value: [] .. py:attribute:: input_top_logprobs_val :type: List[List[float]] :value: [] .. py:attribute:: input_top_logprobs_idx :type: List[List[int]] :value: [] .. py:attribute:: output_top_logprobs_val :type: List[List[float]] :value: [] .. py:attribute:: output_top_logprobs_idx :type: List[List[int]] :value: [] .. py:class:: BatchStrOutput Bases: :py:obj:`BaseBatchReq` .. py:attribute:: finished_reasons :type: List[Optional[str]] .. py:attribute:: output_strs :type: List[str] .. py:attribute:: output_ids :type: Optional[List[int]] .. py:attribute:: prompt_tokens :type: List[int] .. py:attribute:: completion_tokens :type: List[int] .. py:attribute:: input_token_logprobs_val :type: List[float] :value: [] .. py:attribute:: input_token_logprobs_idx :type: List[int] :value: [] .. py:attribute:: output_token_logprobs_val :type: List[float] :value: [] .. py:attribute:: output_token_logprobs_idx :type: List[int] :value: [] .. py:attribute:: input_top_logprobs_val :type: List[List[float]] :value: [] .. py:attribute:: input_top_logprobs_idx :type: List[List[int]] :value: [] .. py:attribute:: output_top_logprobs_val :type: List[List[float]] :value: [] .. py:attribute:: output_top_logprobs_idx :type: List[List[int]] :value: []