Closed merveenoyan closed 1 year ago
I checked out from my documentation PR, feel free to ignore the parts about adding docstrings.
It looks good as a starting point. I just want to ask to add a notebook that shows before and after running create_card()
function to clearly see what the generated model card looks like. WDYT?
@deep-diver sure I'll do that 🙂
@merveenoyan thanks! that would be great 👍🏼
@deep-diver
@merveenoyan is finishing the first version of the model card feature in this PR. She wanted to test HFPusher
(which has the model card utility) in isolation, preferably in a notebook.
Do you have any starter notebook which she could use?
The revision of the test repository lies here, I tested like below (thought it would be good to test deployment in isolation but there might be a problem with HfPusher
calling this, I haven't test separately yet) https://huggingface.co/merve/tfx-blessed-model/blob/merve/README.md
@sayakpaul @deep-diver
import tensorflow as tf
from runner import deploy_model_for_hf_hub
model = model_init() # random dummy model
model.save("./model_save_dir")
model_card_metadata = {}
deploy_model_for_hf_hub(
username="merve",
access_token=access_token,
repo_name="tfx-blessed-model",
model_path="./model_save_dir",
model_version="merve"
)
@deep-diver had to add create_card
to __init__
so it was importable :/
Closes #43
Let's merge this PR as a starting point. @merveenoyan @sayakpaul
There is a couple of things to mention/check:
It looks like Hugging Face Model repo only shows model card in Model Card Tab
in the main
branch. Am I right? Like even though I switch to a certain branch.
I see that you create model_card_template.md
file in Python code. I think it is better if we could keep the template as a static file in the project repo. I have recently upgraded HFPusher to push additional files to Model repository (Link). In this reference, I did it to include custom_handler.py
that refers to the latest branch of a Model repo. Let's see if we could use this feature to include model_card_template.md
in the future. It could automatically inject HF username or some additional metadata.
This is a WIP for model card. Opening this PR so you could take a quick look to see if the behavior seems good. I will add what I can add on top of it (Evaluation results, model plot and so on)