Skip to content

[PoC] Add resources to each model's doc page#19767

Closed
NielsRogge wants to merge 3 commits into
huggingface:mainfrom
NielsRogge:add_resources
Closed

[PoC] Add resources to each model's doc page#19767
NielsRogge wants to merge 3 commits into
huggingface:mainfrom
NielsRogge:add_resources

Conversation

@NielsRogge

Copy link
Copy Markdown
Collaborator

What does this PR do?

This PR is a small PoC to add resources (notebooks, scripts, blogs, etc.) to each model's doc page.

Ideally (not sure if it's possible), but it'd be great if we could (partially) automate this.

The idea being that, if a new model is added to the FOR_IMAGE_CLASSIFICATION_MAPPING for instance, the doc page automatically will add a link to the image classification notebooks and scripts. Not sure if this is possible, cc @sgugger.

@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Oct 20, 2022

Copy link
Copy Markdown

The documentation is not available anymore as the PR was closed or merged.

@lewtun

lewtun commented Oct 20, 2022

Copy link
Copy Markdown
Member

One question I have: does it matter if the resources diverge from the API described in the docs?

@sgugger sgugger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a great idea! I don't think this can be easily automated however as there a re a lot of specific examples.

Comment on lines +92 to +95
- [`ViTForImageClassification`] is supported by the official [image classification scripts](https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification) and [notebooks](https://github.com/huggingface/notebooks/tree/main/examples).
- Demo notebooks regarding inference as well as fine-tuning ViT on custom data can be found [here](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer).
- [`ViTForMaskedImageModeling`] is supported by the official [image pretraining script](https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-pretraining).
- [Blog](https://huggingface.co/blog/fine-tune-vit): Fine-Tune ViT for Image Classification with 🤗 Transformers.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we group those by model class (and thus task)? Here the first and last are both linked to ViTForImageClassification for instance.

- [Blog](https://www.philschmid.de/image-classification-huggingface-transformers-keras): Image Classification with Hugging Face Transformers and `Keras`.
- [Blog](Deploying TensorFlow Vision Models in Hugging Face with TF Serving) Deploying TensorFlow Vision Models in Hugging Face with TF Serving.
- [Blog](https://huggingface.co/blog/deploy-tfserving-kubernetes): Deploying 🤗 ViT on Kubernetes with TF Serving.
- [Blog](https://huggingface.co/blog/deploy-vertex-ai): Deploying 🤗 ViT on Vertex AI.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, group by class and have a section for deployment.

@LysandreJik LysandreJik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like that too. I think it'll be much simpler to understand model architecture this way.

@stevhliu stevhliu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea, I think having the resources directly available here will have the most impact and visibility!


- [`TFViTForImageClassification`] is supported by the [example scripts](https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification) and [example notebooks](https://github.com/huggingface/notebooks/tree/main/examples).
- [Blog](https://www.philschmid.de/image-classification-huggingface-transformers-keras): Image Classification with Hugging Face Transformers and `Keras`.
- [Blog](Deploying TensorFlow Vision Models in Hugging Face with TF Serving) Deploying TensorFlow Vision Models in Hugging Face with TF Serving.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- [Blog](Deploying TensorFlow Vision Models in Hugging Face with TF Serving) Deploying TensorFlow Vision Models in Hugging Face with TF Serving.
- [Blog](https://huggingface.co/blog/tf-serving-vision) Deploying TensorFlow Vision Models in Hugging Face with TF Serving.

@LysandreJik

Copy link
Copy Markdown
Member

@stevhliu, I think this is a pretty significant improvement for the model pages. Would you be down to try doing something similar for other high-profile architectures?

If so, I would encourage the following:

  • Identifty the 20 most popular model architectures, either through number of downloads or through doc pages views
  • Open an issue to track the update of these 20 most popular architectures.
  • Start working on some of them one at a time
  • Open this up to community contributions

Would you be down to kickstart such a project? In doing so, I'm sure we'll have more visibility over what we can automate, and what we cannot automate. I'm pretty sure we can automate a portion of it but I don't think we can have high-quality resources here only using automation.

@NielsRogge

Copy link
Copy Markdown
Collaborator Author

Closing this PR as it was just a PoC. Will continue the work in other PRs

@NielsRogge NielsRogge closed this Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants