data_juicer.ops.mapper.python_file_mapper module#
- class data_juicer.ops.mapper.python_file_mapper.PythonFileMapper(file_path: str = '', function_name: str = 'process_single', batched: bool = False, **kwargs)[source]#
Bases:
MapperMapper for executing Python function defined in a file.
- __init__(file_path: str = '', function_name: str = 'process_single', batched: bool = False, **kwargs)[source]#
Initialization method.
- Parameters:
file_path â The path to the Python file containing the function to be executed.
function_name â The name of the function defined in the file to be executed.
batched â A boolean indicating whether to process input data in batches.
kwargs â Additional keyword arguments passed to the parent class.