trinity.buffer.operators.data_juicer_operator module#

class trinity.buffer.operators.data_juicer_operator.DataJuicerOperator(service_config: DataJuicerServiceConfig, operators: List[Dict] | None = None, config_path: str | None = None, np: int = 4)[源代码]#

基类:ExperienceOperator

__init__(service_config: DataJuicerServiceConfig, operators: List[Dict] | None = None, config_path: str | None = None, np: int = 4)[源代码]#

Initialize the DataJuicerOperator.

参数:
  • service_config (config) -- The configuration for the DataJuicer service.

  • operators (List[Dict]) -- A list of operators with their configurations.

  • config_path (str) -- Path to the Data-Juicer configuration file.

  • np (int) -- Number of processes to use for Data-Juicer. Default is 4.

备注

  • Must include one of the following, and the priority is from high to low:
    • config_path (str)

    • operators (List[Dict])

process(exps: List[Experience]) Tuple[List[Experience], Dict][源代码]#

Process a list of experiences and return a transformed list.

参数:

exps (List[Experience]) -- List of experiences to process, which contains all experiences generated by the Explorer in one explore step.

返回:

A tuple containing the processed list of experiences and a dictionary of metrics.

返回类型:

Tuple[List[Experience], Dict]

close()[源代码]#

Close the DataJuicer client connection.