data_juicer.core.executor.ray_executor module

class data_juicer.core.executor.ray_executor.TempDirManager(tmp_dir)[source]

Bases: object

__init__(tmp_dir)[source]
class data_juicer.core.executor.ray_executor.RayExecutor(cfg: Namespace | None = None)[source]

Bases: ExecutorBase

Executor based on Ray.

Run Data-Juicer data processing in a distributed cluster.

  1. Support Filter, Mapper and Exact Deduplicator operators for now.

  2. Only support loading .json files.

  3. Advanced functions such as checkpoint, tracer are not supported.

__init__(cfg: Namespace | None = None)[source]

Initialization method.

Parameters:

cfg – optional config dict.

run(load_data_np: Annotated[int, Gt(gt=0)] | None = None, skip_export: bool = False, skip_return: bool = False)[source]

Running the dataset process pipeline

Parameters:
  • load_data_np – number of workers when loading the dataset.

  • skip_export – whether export the results into disk

  • skip_return – skip return for API called.

Returns:

processed dataset.