| import re | |
| def fix_url(files): | |
| ans = [] | |
| target_date = 20260101 | |
| cpu_pattern = r"k2-(\d)\.(\d)+((\.)(\d))?\.dev(\d{8})\+cpu\.torch(\d\.\d+\.\d)(\.dev(\d{8}))?-cp(\d+)" | |
| cuda_pattern = r"k2-(\d)\.(\d)+((\.)(\d))?\.dev(\d{8})\+cuda(\d+)\.(\d+)\.torch(\d\.\d+\.\d(\.dev\d{8})?)-cp(\d+)" | |
| for f in files: | |
| whl = f.rsplit("/", maxsplit=1)[1] | |
| if "cuda" in whl: | |
| m = re.search(cuda_pattern, whl) | |
| else: | |
| m = re.search(cpu_pattern, whl) | |
| date = int(m.group(6)) | |
| if date >= target_date: | |
| f = f.replace("csukuangfj", "csukuangfj2") | |
| ans.append(f) | |
| return ans | |