Greetings, good people
I am researching the structure of the model card template and wonder what argument can each slot accept as input
For example: in the field MODEL SOURCE, I can assument the choice of argument is paper/repo/demo *taken from the info in the field description , but in other fields such as for example MODEL TYPE or TRAINING PROCEDURE etc there arent any clues. just wondering. thanks, pointers appreciated
1 Like
I think anything is acceptable as long as it does not violate the YAML format. Whether or not it will be interpreted in a special way depends on the implementation of the Hub. For example, this.
Thank you John, things is I dont speak much code so I really stick with model cards. if I understand you correctlyl, any litteral string , Like in this example? How to represent strings in YAML Is there a way to look up the list of arguments already used in HF? *so that I may derive a model from that?
1 Like
In that case, it would probably be safer to use HfApi
for crawling. When I searched for tags before, there were more than I expected…
Thank you John
any chance of a tutorial?
1 Like
I got it like this. Nothing special.
from huggingface_hub import HfApi
from collections import Counter
def get_tags():
api = HfApi()
tags_list = []
spaces = api.list_spaces(full=True, limit=10)
for i in spaces:
if i.tags is not None: tags_list.extend(i.tags)
models = api.list_models(full=True, cardData=True, limit=10)
for i in models:
if i.tags is not None: tags_list.extend(i.tags)
datasets = api.list_datasets(full=True, limit=10)
for i in datasets:
if i.tags is not None: tags_list.extend(i.tags)
tags_dict = dict(Counter(tags_list))
print(tags_dict)
get_tags()