Skip to content

Commit

Permalink
Add visibility to the database
Browse files Browse the repository at this point in the history
  • Loading branch information
KareemMAX committed Jan 18, 2024
1 parent b971598 commit 0e9d9f9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/database_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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):
Expand All @@ -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)


Expand Down
11 changes: 11 additions & 0 deletions tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
# 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
# tags:
# - tag1
# groups:
# - group1
# tags: # list of tags in this group
# - tag1
tags:
categories:
description: "Categories specific tags"
visible: false
min: 1
tags:
- compilers
Expand All @@ -26,6 +30,7 @@ tags:
tags:
- compilers
tags:
- compilers
- mlir
- llvm
- inference-optimizer
Expand All @@ -37,6 +42,7 @@ tags:
tags:
- compression
tags:
- compression
- distillation
- quantization
- tensorization
Expand All @@ -51,6 +57,7 @@ tags:
tags:
- hardware
tags:
- hardware
- custom-hardware

serving:
Expand All @@ -60,6 +67,7 @@ tags:
tags:
- serving
tags:
- serving
- container
- model-endpoint
- inference
Expand All @@ -71,6 +79,7 @@ tags:

modality:
description: "Type of model specific tags"
visible: false
tags:
- llm
- vision
Expand Down Expand Up @@ -104,6 +113,7 @@ tags:

general:
description: "General classification tags"
visible: false
tags:
- open-source
- framework
Expand All @@ -116,6 +126,7 @@ tags:

license:
description: "License specific tags"
visible: false
min: 1
depends_on:
tags:
Expand Down

0 comments on commit 0e9d9f9

Please sign in to comment.