Skip to content

Commit 7fd14e2

Browse files
committed
Fixes mlcommons#165, add support for exact_tags_search
1 parent 4b729f6 commit 7fd14e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlc/action.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,7 @@ def search(self, i):
653653
uid = i.get("uid")
654654
alias = i.get("alias")
655655
item_repo = i.get('item_repo')
656+
exact_tags_match = i.get('exact_tags_match', False)
656657
fetch_all = True if i.get('fetch_all') else False
657658

658659
# For targets like cache, sometimes user would need to clear the entire cache folder present in the system
@@ -725,7 +726,7 @@ def search(self, i):
725726
p_tags = list(set(tags_to_match) - set(n_tags_))
726727
for res in target_index:
727728
c_tags = res["tags"]
728-
if set(p_tags).issubset(set(c_tags)) and set(n_tags).isdisjoint(set(c_tags)):
729+
if (exact_tags_match and set(p_tags) == set(c_tags)) or (not exact_tags_match and set(p_tags).issubset(set(c_tags)) and set(n_tags).isdisjoint(set(c_tags))):
729730
it = Item(res['path'], res['repo'])
730731
result.append(it)
731732
return {'return': 0, 'list': result}

0 commit comments

Comments
 (0)