Skip to content

Commit bbb7856

Browse files
committed
Add CSP info to Hugging Face report
1 parent 0600497 commit bbb7856

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

tools/count-huggingface-lps.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
REPO_DIR = "arm-learning-paths"
1818
OUTPUT_MD = "huggingface_learning_paths.md"
1919

20-
LearningPath = namedtuple('LearningPath', ['title', 'category', 'path'])
20+
LearningPath = namedtuple('LearningPath', ['title', 'category', 'path', 'csps'])
2121

2222
def extract_front_matter(file_path):
2323
"""Extract YAML front matter from a markdown file."""
@@ -64,19 +64,28 @@ def find_huggingface_learning_paths(repo_dir):
6464
print(f"DEBUG: {category}/{lp} parsed tags: {tags}")
6565
if any(tag.lower() == "hugging face" for tag in tags):
6666
title = fm.get('title', lp)
67-
print(f"FOUND: {title} in {category}")
68-
results.append(LearningPath(title=title, category=category, path=f"{category}/{lp}"))
67+
# Extract cloud service provider tags
68+
csp_raw = fm.get('cloud_service_providers', [])
69+
if isinstance(csp_raw, str):
70+
csps = [c.strip() for c in csp_raw.split(',')]
71+
elif isinstance(csp_raw, list):
72+
csps = [str(c).strip() for c in csp_raw]
73+
else:
74+
csps = []
75+
print(f"FOUND: {title} in {category} CSPs: {csps}")
76+
results.append(LearningPath(title=title, category=category, path=f"{category}/{lp}", csps=csps))
6977
return results
7078

7179
def write_markdown_table(learning_paths, output_file):
7280
with open(output_file, 'w') as f:
7381
f.write("# Hugging Face Learning Paths\n\n")
7482
f.write(f"Total Hugging Face Learning Paths: {len(learning_paths)}\n\n")
75-
f.write("| Title | Category |\n")
76-
f.write("|-------|----------|\n")
83+
f.write("| Title | Category | CSP |\n")
84+
f.write("|-------|----------|-----|\n")
7785
for lp in learning_paths:
7886
url = f"https://learn.arm.com/learning-paths/{lp.path}"
79-
f.write(f"| [{lp.title}]({url}) | {lp.category} |\n")
87+
csp_str = ", ".join(lp.csps) if lp.csps else ""
88+
f.write(f"| [{lp.title}]({url}) | {lp.category} | {csp_str} |\n")
8089
print(f"Markdown report written to {output_file}")
8190

8291
def main():

0 commit comments

Comments
 (0)