Skip to content

Commit c488b19

Browse files
authored
PR template when adding a new library (#913)
This PR adds a template with a checklist to follow when adding a new library. Based on https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository. Once merged, we should be able to generate a link to create such a PR (the template will not be used by default for all PRs 😄). This link would be added to https://huggingface.co/docs/hub/models-download-stats#can-i-add-my-query-files-for-my-library. Hopefully, this should reduce the back-and-fourth when someone adds a new library. I suggest we start with that as an experiment and if it doesn't work, we can move it somewhere else as documentation.
1 parent e04bd52 commit c488b19

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# What does this PR do?
2+
3+
This PR adds support for the library [TO BE COMPLETED].
4+
5+
Link to library repo: [TO BE COMPLETED].
6+
7+
Link to models on the Hub: https://huggingface.co/models?other=[to-be-completed].
8+
9+
## Main instructions
10+
11+
Please check that all prerequisites are met.
12+
13+
- [ ] A new library has been added to [model-libraries.ts](https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/model-libraries.ts#L60).
14+
- [ ] The alphabetical order of `MODEL_LIBRARIES_UI_ELEMENTS` has been preserved.
15+
- [ ] The library id is lowercased and hyphen-separated (example: `"adapter-transformers"`).
16+
- [ ] At least one model is referenced on https://huggingface.co/models?other=my-library-name. If not, the model card metadata of the relevant models must be updated to add `library_name: my-library-name` (see [example](https://huggingface.co/google/gemma-scope/blob/main/README.md?code=true#L3)). If you are not the owner of the models on the Hub, please open PRs (see [example](https://huggingface.co/MCG-NJU/VFIMamba/discussions/1)). **Note:** if no models are listed, this PR won't be merged.
17+
- [ ] `repoName` and `prettyLabel` are set with user-friendly casing (example: `DeepForest`).
18+
- [ ] `repoUrl` is set with a link to the library source code (usually a GitHub repository).
19+
- [ ] (optional) `docsUrl` is set with a link to the docs of the library. If the documentation is in the GitHub repo referenced above, no need to set it twice.
20+
- [ ] `filter` is set to `false`.
21+
- [ ] `countDownload` follows the correct convention and do not duplicate the counting. For instance, if loading a model requires 3 files, the download count rule must count downloads only on 1 of the 3 files. Otherwise, the download count will be overestimated. If the library uses one of the default config files (`config.json`, `config.yaml`, `hyperparams.yaml`, and `meta.yaml`, see [here](https://huggingface.co/docs/hub/models-download-stats#which-are-the-query-files-for-different-libraries)), there is no need to manually define a download count rule.
22+
- [ ] (optional) `snippets` is correctly defined. See check-list below.
23+
- [ ] Make sure that the code passes the linter test as well
24+
25+
## (optional) Snippets instructions
26+
27+
Adding a code snippet helps users to start using your library. It is especially useful when the library is tightly integrated with the Hub and typically has a `Model.from_pretrained` helper method. Check out [this guide](https://huggingface.co/docs/huggingface_hub/guides/download) to learn how to download files in Python and [this guide](https://huggingface.co/docs/huggingface_hub/guides/integrations) for a broader explanation on how to integrate a library with the Hub. Note that adding a code snippet is optional.
28+
For code snippets specifically, please refer to this checklist:
29+
30+
- [ ] Code snippet has been defined in [model-libraries-snippets.ts](https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/model-libraries-snippets.ts) and added to [model-libraries.ts](https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/model-libraries.ts#L60).
31+
- [ ] Code snippet does not contain installation instruction.
32+
- [ ] Code snippet is minimal (only loading / calling the model with simple config).
33+
- [ ] (recommended) Code snippet is generated from `ModelData`, typically to get the correct command to load a specific model.
34+
- [ ] (optional) It's possible to define multiple code snippets (by returning a list) to showcase different usage.

0 commit comments

Comments
 (0)