Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 3 commits into from

Conversation

NielsRogge
Copy link
Contributor

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
Copy link

HuggingFaceDocBuilderDev commented Oct 20, 2022

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

@lewtun
Copy link
Member

lewtun commented Oct 20, 2022

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

Copy link
Collaborator

@sgugger sgugger left a comment

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
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
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.

Copy link
Member

@LysandreJik LysandreJik left a comment

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.

Copy link
Member

@stevhliu stevhliu left a comment

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
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
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
Contributor 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