Spaces:
Runtime error
Runtime error
File size: 421 Bytes
ba411b1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import os
def get_pth_file(dir_path):
file_list = []
for root, dirs, files in os.walk(dir_path):
for file in files:
if file.endswith("pth"):
file_list.append(os.path.join(root, file))
return file_list
file_list = get_pth_file("./")
epoch = max([epochs.split("/")[-1].split("_")[0] for epochs in file_list])
pth_path = f"{epoch}_epochs.pth"
config_json = "config.json"
|