deep-diver / semantic-segmentation-ml-pipeline

Machine Learning Pipeline for Semantic Segmentation with TensorFlow Extended (TFX) and various GCP products
https://blog.tensorflow.org/2023/01/end-to-end-pipeline-for-segmentation-tfx-google-cloud-hugging-face.html
Apache License 2.0
93 stars 20 forks source link

WIP Model card #53

Closed merveenoyan closed 1 year ago

merveenoyan commented 1 year ago

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)

merveenoyan commented 1 year ago

I checked out from my documentation PR, feel free to ignore the parts about adding docstrings.

deep-diver commented 1 year ago

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?

merveenoyan commented 1 year ago

@deep-diver sure I'll do that 🙂

deep-diver commented 1 year ago

@merveenoyan thanks! that would be great 👍🏼

sayakpaul commented 1 year ago

@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?

merveenoyan commented 1 year ago

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"
)
merveenoyan commented 1 year ago

@deep-diver had to add create_card to __init__so it was importable :/

merveenoyan commented 1 year ago

Closes #43

deep-diver commented 1 year ago

Let's merge this PR as a starting point. @merveenoyan @sayakpaul

There is a couple of things to mention/check: