diff --git a/scripts/database_generator.py b/scripts/database_generator.py index 7129662..45226c7 100644 --- a/scripts/database_generator.py +++ b/scripts/database_generator.py @@ -56,6 +56,7 @@ def empty(self): class TagGroup: name: str = "" description: str = "" + visible: bool = True tags: tuple[str] = tuple() min: int = 0 max: int = math.inf @@ -68,13 +69,16 @@ def from_dict(obj: dict[str, dict[str, dict | list | str]]) -> list["TagGroup"]: for key, value in obj.items(): name = key description = value.get("description", "") + visible = value.get("visible", True) tags = value.get("tags", []) min_items = value.get("min", 0) max_items = value.get("max", math.inf) depends_on = DependencyRestriction.from_yml(value.get("depends_on")) ret.append( - TagGroup(name, description, tags, min_items, max_items, depends_on) + TagGroup( + name, description, visible, tags, min_items, max_items, depends_on + ) ) return ret @@ -284,6 +288,7 @@ def main(): with open("build/tags.json", "w", encoding="utf-8") as f: json.dump(tags, f) with open("build/tag-groups.json", "w", encoding="utf-8") as f: + filtered_groups = [group for group in tag_groups if group.visible] def default(o): if isinstance(o, set): @@ -293,7 +298,7 @@ def default(o): return {k: v for k, v in o.__dict__.items() if k in allowed_keys} - json.dump(tag_groups, f, default=default) + json.dump(filtered_groups, f, default=default) generate_sitemap(database) diff --git a/tags.yaml b/tags.yaml index c45d524..7758b8d 100644 --- a/tags.yaml +++ b/tags.yaml @@ -2,6 +2,7 @@ # The tag group schema is: # group-name: # description: "Group description" +# visible: true # whether the group should be visible in the UI # min: 1 # minimum number of tags from this group # max: 1 # maximum number of tags from this group # depends_on: # tags or groups that must be present for this group to be valid @@ -9,9 +10,12 @@ # - tag1 # groups: # - group1 +# tags: # list of tags in this group +# - tag1 tags: categories: description: "Categories specific tags" + visible: false min: 1 tags: - compilers @@ -26,6 +30,7 @@ tags: tags: - compilers tags: + - compilers - mlir - llvm - inference-optimizer @@ -37,6 +42,7 @@ tags: tags: - compression tags: + - compression - distillation - quantization - tensorization @@ -51,6 +57,7 @@ tags: tags: - hardware tags: + - hardware - custom-hardware serving: @@ -60,6 +67,7 @@ tags: tags: - serving tags: + - serving - container - model-endpoint - inference @@ -71,6 +79,7 @@ tags: modality: description: "Type of model specific tags" + visible: false tags: - llm - vision @@ -104,6 +113,7 @@ tags: general: description: "General classification tags" + visible: false tags: - open-source - framework @@ -116,6 +126,7 @@ tags: license: description: "License specific tags" + visible: false min: 1 depends_on: tags: