CodeFormer
CodeFormer copied to clipboard
fix: use regexp to extract pytorch version in misc.py
Hi @sczhou , I've test above version, all cases are passed:
1.0.0
2.1.2
1.0.0a1
1.0.0a1+git
2.1.0.dev20230728+cu121
2.1.0a0+b5021ba
2.0.0.dev20230219+cu118
online review link: https://regex101.com/r/pfxFFI/1
ref: #148 #279 #280
hi! This commit wont catch pytorch installs with rocm, such as 1.13.1+rocm5.2. Maybe shouldn´t we remove $ at the end of regex?
Like this?
IS_HIGH_VERSION = [int(m) for m in list(re.findall(r"^(\d+).(\d+).(\d+)([\w\d.].*)?",
torch.version)[0][:3])] >= [1, 12, 0]
This will it will catch 1.13.1 and ignore +rocm5.2