cerebras.modelzoo.data_preparation.data_preprocessing.data_preprocessor.check_and_create_dir#

cerebras.modelzoo.data_preparation.data_preprocessing.data_preprocessor.check_and_create_dir(dir, split_dir)[source]#

Ensures a directory exists, optionally handling a subdirectory. It prompts the user for action if the directory already has files.

Args: dir (Optional[str]): Base directory path. Defaults to ‘input_dir’ in cwd. split_dir (Optional[str]): Subdirectory to add to the base directory.

Returns: str: The final directory path ensured to exist.