csukuangfj commited on
Commit
48d0e71
1 Parent(s): 818e66a

small fixes

Browse files
Files changed (3) hide show
  1. cpu.md +0 -0
  2. update-cuda-html.py +5 -4
  3. update-k2-doc-cuda-linux.py +7 -4
cpu.md CHANGED
The diff for this file is too large to render. See raw diff
 
update-cuda-html.py CHANGED
@@ -20,9 +20,10 @@ class Wheel:
20
  Args:
21
  full_name:
22
  Example: k2-1.23.4.dev20230224+cuda10.1.torch1.6.0-cp36-cp36m-linux_x86_64.whl
 
23
  """
24
- self.full_name = full_name
25
- pattern = r"k2-(\d)\.(\d)+((\.)(\d))?\.dev(\d{8})\+cuda(\d+)\.(\d+)\.torch(\d\.\d+\.\d)-cp(\d+)"
26
  m = re.search(pattern, full_name)
27
 
28
  self.k2_major = int(m.group(1))
@@ -32,12 +33,12 @@ class Wheel:
32
  self.cuda_major_version = int(m.group(7))
33
  self.cuda_minor_version = int(m.group(8))
34
  self.torch_version = m.group(9)
35
- self.py_version = int(m.group(10))
36
  self.url = url
37
 
38
 
39
  def sort_by_wheel(x: Wheel):
40
- torch_major, torch_minor, torch_patch = x.torch_version.split(".")
41
  torch_major = int(torch_major)
42
  torch_minor = int(torch_minor)
43
  torch_patch = int(torch_patch)
 
20
  Args:
21
  full_name:
22
  Example: k2-1.23.4.dev20230224+cuda10.1.torch1.6.0-cp36-cp36m-linux_x86_64.whl
23
+ k2-1.24.4.dev20240301+cuda12.1.torch2.3.0.dev20240229-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
24
  """
25
+ self.full_name = str(full_name)
26
+ pattern = r"k2-(\d)\.(\d)+((\.)(\d))?\.dev(\d{8})\+cuda(\d+)\.(\d+)\.torch(\d\.\d+\.\d(\.dev\d{8})?)-cp(\d+)"
27
  m = re.search(pattern, full_name)
28
 
29
  self.k2_major = int(m.group(1))
 
33
  self.cuda_major_version = int(m.group(7))
34
  self.cuda_minor_version = int(m.group(8))
35
  self.torch_version = m.group(9)
36
+ self.py_version = int(m.group(11))
37
  self.url = url
38
 
39
 
40
  def sort_by_wheel(x: Wheel):
41
+ torch_major, torch_minor, torch_patch = x.torch_version.split(".")[:3]
42
  torch_major = int(torch_major)
43
  torch_minor = int(torch_minor)
44
  torch_patch = int(torch_patch)
update-k2-doc-cuda-linux.py CHANGED
@@ -15,9 +15,10 @@ class Wheel:
15
  Args:
16
  full_name:
17
  Example: k2-1.23.4.dev20230224+cuda10.1.torch1.6.0-cp36-cp36m-linux_x86_64.whl
 
18
  """
19
  self.full_name = full_name
20
- pattern = r"k2-(\d)\.(\d)+((\.)(\d))?\.dev(\d{8})\+cuda(\d+)\.(\d+)\.torch(\d\.\d+\.\d)-cp(\d+)"
21
  m = re.search(pattern, full_name)
22
 
23
  self.k2_major = int(m.group(1))
@@ -27,7 +28,7 @@ class Wheel:
27
  self.cuda_major_version = int(m.group(7))
28
  self.cuda_minor_version = int(m.group(8))
29
  self.torch_version = m.group(9)
30
- self.py_version = int(m.group(10))
31
  self.url = url
32
 
33
  def __str__(self):
@@ -78,7 +79,7 @@ def sort_by_torch(x):
78
  def get_all_torch_versions(wheels: List[Wheel]) -> List[str]:
79
  ans = set()
80
  for w in wheels:
81
- ans.add(w.torch_version)
82
 
83
  # sort torch version from high to low
84
  ans = list(ans)
@@ -118,7 +119,9 @@ def generate_file(d: str, torch_version: str, wheels: List[Wheel]) -> str:
118
  s = f"torch {torch_version}\n"
119
  s += "=" * len(f"torch {torch_version}")
120
  s += "\n" * 3
121
- wheels = filter(lambda w: w.torch_version == torch_version, wheels)
 
 
122
  wheels = list(wheels)
123
  wheels.sort(reverse=True, key=sort_by_wheel)
124
  for w in wheels:
 
15
  Args:
16
  full_name:
17
  Example: k2-1.23.4.dev20230224+cuda10.1.torch1.6.0-cp36-cp36m-linux_x86_64.whl
18
+ k2-1.24.4.dev20240301+cuda12.1.torch2.3.0.dev20240229-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
19
  """
20
  self.full_name = full_name
21
+ pattern = r"k2-(\d)\.(\d)+((\.)(\d))?\.dev(\d{8})\+cuda(\d+)\.(\d+)\.torch(\d\.\d+\.\d(\.dev\d{8})?)-cp(\d+)"
22
  m = re.search(pattern, full_name)
23
 
24
  self.k2_major = int(m.group(1))
 
28
  self.cuda_major_version = int(m.group(7))
29
  self.cuda_minor_version = int(m.group(8))
30
  self.torch_version = m.group(9)
31
+ self.py_version = int(m.group(11))
32
  self.url = url
33
 
34
  def __str__(self):
 
79
  def get_all_torch_versions(wheels: List[Wheel]) -> List[str]:
80
  ans = set()
81
  for w in wheels:
82
+ ans.add(".".join(w.torch_version.split(".")[:3]))
83
 
84
  # sort torch version from high to low
85
  ans = list(ans)
 
119
  s = f"torch {torch_version}\n"
120
  s += "=" * len(f"torch {torch_version}")
121
  s += "\n" * 3
122
+ wheels = filter(
123
+ lambda w: ".".join(w.torch_version.split(".")[:3]) == torch_version, wheels
124
+ )
125
  wheels = list(wheels)
126
  wheels.sort(reverse=True, key=sort_by_wheel)
127
  for w in wheels: