Skip to content

[Docs] Model_doc structure/clarity improvements#26876

Merged
MKhalusova merged 8 commits intohuggingface:mainfrom
MKhalusova:model_doc_cleanup
Nov 3, 2023
Merged

[Docs] Model_doc structure/clarity improvements#26876
MKhalusova merged 8 commits intohuggingface:mainfrom
MKhalusova:model_doc_cleanup

Conversation

@MKhalusova
Copy link
Contributor

@MKhalusova MKhalusova commented Oct 17, 2023

This PR streamlines pages in model_doc, so that a user who has seen at least one of these pages, should find it easier to navigate throughout any other model_doc page. These are the changes:

  1. Individual pages now have (with a few exceptions) the same structure: overview, followed by author acknowledgement, usage tips and/or examples, resources (other docs, notebooks, blog posts, etc.), API reference (autodoc). Previously, some pages did not have the same order which could make searching through them confusing.
  2. Usage tips now have their own section with a header. Previously, they often have been buried within the overview section, now one can find them faster.
  3. In cases where a model has the same architecture as another model, a visible <Tip> has been added with a link to API reference of the original model.
  4. “Documentation resources” and “resources” were combined into “Resources”
  5. For models that support TF and JAX, a <framework> tag was added so that a user could collapse sections irrelevant to them.
  6. Removed disclaimers like “This model has been recently added. If you see something strange, file a GitHub Issue” for models that have been in the library longer than 1 year.

The PR aims to:

  • Make it easier to find usage tips and examples
  • Make it easier to find API reference for models that are based on another model’s architecture
  • Possibly reduce the bloat by letting the users collapse framework-specific sections
  • Streamline the model_doc pages structure

@MKhalusova MKhalusova marked this pull request as ready for review October 17, 2023 18:31
@MKhalusova MKhalusova marked this pull request as draft October 17, 2023 18:32
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 23, 2023

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

@MKhalusova MKhalusova marked this pull request as ready for review October 24, 2023 11:55
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.

Wow really nice! 🎉 I love the idea of standardizing the pages so it's more consistent when going from model page to model page.

@MKhalusova
Copy link
Contributor Author

If @ArthurZucker is busy, maybe @amyeroberts could take a look?

Copy link
Contributor

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Mammoth piece of work! Thanks for all of this effort in making our documentation better ❤️

Main comment is about the tips for vision models mentioning the image processors. I realise this isn't something you added (I've approved in PRs) - it's just now in the refactoring and moving to tips I see it's not needed.

Comment on lines +48 to +51
<Tip>

Use [`VideoMAEImageProcessor`] to prepare videos for the model. It will resize + normalize all frames of a video for you.
</Tip>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure whether we need this tip. All the processing classes (tokenizers, image processors, feature extractors etc.) prepare the raw data for the model

[[autodoc]] BitForImageClassification
- forward

No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change


## Usage tips

- Use [`DeformableDetrImageProcessor`] to prepare images (and optional targets) for the model.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure we need this tip - this is true for all vision models and their image processors

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I'll address this.


<Tip>

Use [`DetaImageProcessor`] to prepare images and optional targets for the model.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here re needing the tip

Comment on lines +33 to +36
<Tip>

Use the [`AutoImageProcessor`] class to prepare images for the model.
</Tip>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here


If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.

<Tip>
Copy link
Contributor

Choose a reason for hiding this comment

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

And here

Tips:

There are many pretrained variants. Select your pretrained model based on the dataset it is trained on. Moreover, the number of input frames per clip changes based on the model size so you should consider this parameter while selecting your pretrained model.
There are many pretrained variants. Select your pretrained model based on the dataset it is trained on. Moreover,
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like it falls under a useage tip

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for noticing! I missed this one.

- A demo notebook for the Table Transformer can be found [here](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/Table%20Transformer).
- It turns out padding of images is quite important for detection. An interesting Github thread with replies from the authors can be found [here](https://github.com/microsoft/table-transformer/issues/68).

<Tip>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here


If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.

<Tip>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

This model was contributed by [nielsr](https://huggingface.co/nielsr).
The original code can be found [here](https://github.com/facebookresearch/dinov2).

<Tip>
Copy link
Contributor

Choose a reason for hiding this comment

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

And here

@MKhalusova MKhalusova merged commit 5964f82 into huggingface:main Nov 3, 2023
@amyeroberts amyeroberts mentioned this pull request Nov 8, 2023
4 tasks
@amyeroberts amyeroberts mentioned this pull request Nov 15, 2023
EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 19, 2023
* first batch of structure improvements for model_docs

* second batch of structure improvements for model_docs

* more structure improvements for model_docs

* more structure improvements for model_docs

* structure improvements for cv model_docs

* more structural refactoring

* addressed feedback about image processors
@amyeroberts amyeroberts mentioned this pull request Nov 20, 2023
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.

4 participants