def create_experiment_workspace(
    output_dir: str, model_name: str = None, config: dict = None, exp_name: str = None
) -> tuple[str, str]:
    """
    This function creates a folder for experiment tracking.

    Args:
        output_dir: The path to the output directory.
        model_name: The name of the model.
        exp_name: The given name of the experiment, if None will use default.

    Returns:
        tuple[str, str]: The experiment name and the experiment directory.
    """
    if exp_name is None:
        # Make outputs folder (holds all experiment subfolders)
        experiment_index = datetime.now().strftime("%y%m%d_%H%M%S")
        experiment_index = sync_string(experiment_index)
        # Create an experiment folder
        model_name = (
            "-" + model_name.replace("/", "-") if model_name is not None else ""
        )
        exp_name = f"{experiment_index}{model_name}"
    exp_dir = f"{output_dir}/{exp_name}"
    if is_main_process():
        os.makedirs(exp_dir, exist_ok=True)
        # Save the config
        with open(f"{exp_dir}/config.txt", "w", encoding="utf-8") as f:
            json.dump(config, f, indent=4)

    return exp_name, exp_dir

    This function creates a folder for experiment tracking.

    Args:
        output_dir: The path to the output directory.
        model_name: The name of the model.
        exp_name: The given name of the experiment, if None will use default.

    Returns:
        tuple[str, str]: The experiment name and the experiment directory.
    
opensora/utils/config.py