csukuangfj commited on
Commit
5d089ed
·
1 Parent(s): d4b2424

update script

Browse files
Files changed (2) hide show
  1. update-cpu-html.py +1 -0
  2. util.py +18 -2
update-cpu-html.py CHANGED
@@ -62,6 +62,7 @@ def main():
62
  wheels = get_all_files("macos", suffix="*.whl")
63
  wheels += get_all_files("ubuntu-cpu", suffix="*.whl")
64
  wheels += get_all_files("windows-cpu", suffix="*.whl")
 
65
  urls = generate_url(wheels)
66
 
67
  wheels = []
 
62
  wheels = get_all_files("macos", suffix="*.whl")
63
  wheels += get_all_files("ubuntu-cpu", suffix="*.whl")
64
  wheels += get_all_files("windows-cpu", suffix="*.whl")
65
+ wheels += get_all_files("cpu", suffix="*.whl")
66
  urls = generate_url(wheels)
67
 
68
  wheels = []
util.py CHANGED
@@ -1,7 +1,8 @@
1
  #!/usr/bin/env python3
2
 
3
- from typing import List
4
  from pathlib import Path
 
5
 
6
  BASE_URL = "https://huggingface.co/csukuangfj/kaldifeat/resolve/main/"
7
 
@@ -15,4 +16,19 @@ def generate_url(files: List[str]) -> List[str]:
15
 
16
 
17
  def get_all_files(d: str, suffix: str) -> List[str]:
18
- return sorted(Path(d).glob(suffix), reverse=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #!/usr/bin/env python3
2
 
3
+ import os
4
  from pathlib import Path
5
+ from typing import List
6
 
7
  BASE_URL = "https://huggingface.co/csukuangfj/kaldifeat/resolve/main/"
8
 
 
16
 
17
 
18
  def get_all_files(d: str, suffix: str) -> List[str]:
19
+ if "*" in suffix:
20
+ suffix = suffix.split(".")[-1]
21
+
22
+ d_list = d
23
+
24
+ if isinstance(d_list, str):
25
+ d_list = [d_list]
26
+
27
+ ss = []
28
+ for d in d_list:
29
+ for root, _, files in os.walk(d):
30
+ for f in files:
31
+ if f.endswith(suffix):
32
+ ss.append(os.path.join(root, f))
33
+
34
+ return sorted(ss, reverse=True)