File size: 864 Bytes
20f7859
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
import gdown

# 检查checkpoints文件夹是否存在,如果不存在则创建
checkpoints_dir = './checkpoints'
if not os.path.exists(checkpoints_dir):
    os.makedirs(checkpoints_dir)
    print(f"已创建文件夹: {checkpoints_dir}")

# 设置checkpoint.pt的完整路径
checkpoint_file = os.path.join(checkpoints_dir, 'checkpoint.pt')

# 检查checkpoint.pt是否已存在
if not os.path.exists(checkpoint_file):
    # 从你的链接中提取的文件ID
    file_id = '1cuvdiu3bXyni71A2hoeZSWT1NOsNfeD_'
    
    # 构建下载URL
    download_url = f'https://drive.google.com/uc?id={file_id}'
    
    # 下载文件
    print(f"正在下载文件到: {checkpoint_file}")
    gdown.download(download_url, checkpoint_file, quiet=False)
    print("下载完成!")
else:
    print(f"文件已存在: {checkpoint_file}")