def set_exp_folder(args):
    '''
    Create a folder to store experimental results e.g., checkpoints or log
    '''
    os.makedirs(os.path.join(args.output_dir, 'output'), exist_ok=True) 

    if os.path.exists(os.path.join('output', args.exp_name)):
        if not args.overwrite_output_dir: 
            assert False, 'The exp_name is already used. Please modify the experiment name or use --overwrite_output_dir'
        else:
            print('Remove original directories.')
            shutil.rmtree(os.path.join('output', args.exp_name))
            print('Remove successfully.')
    
    os.makedirs(os.path.join(args.output_dir, 'output', args.exp_name), exist_ok=True)
    exp_path = os.path.join(args.output_dir, 'output', args.exp_name)
    print(f'Path [{exp_path}] has been created')

    Create a folder to store experimental results e.g., checkpoints or log
    
xdoc/fine_tuning/websrc/util.py