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

New api docs structure #1379

Merged
merged 42 commits into from
Sep 12, 2024
Merged

New api docs structure #1379

merged 42 commits into from
Sep 12, 2024

Conversation

osanseviero
Copy link
Contributor

@osanseviero osanseviero commented Aug 19, 2024

(see discussion in private google docs)

docs/api-inference/overview.md Outdated Show resolved Hide resolved
docs/api-inference/overview.md Outdated Show resolved Hide resolved
Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

Very cool re-org!

docs/api-inference/_toctree.yml Outdated Show resolved Hide resolved
docs/api-inference/index.md Outdated Show resolved Hide resolved
docs/api-inference/index.md Outdated Show resolved Hide resolved
docs/api-inference/overview.md Outdated Show resolved Hide resolved
docs/api-inference/overview.md Outdated Show resolved Hide resolved
docs/api-inference/overview.md Outdated Show resolved Hide resolved
docs/api-inference/overview.md Outdated Show resolved Hide resolved
docs/api-inference/overview.md Outdated Show resolved Hide resolved
docs/api-inference/rate_limits.md Outdated Show resolved Hide resolved
docs/api-inference/rate_limits.md Outdated Show resolved Hide resolved
Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

🔥

docs/api-inference/_toctree.yml Outdated Show resolved Hide resolved
docs/api-inference/index.md Outdated Show resolved Hide resolved
docs/api-inference/overview.md Outdated Show resolved Hide resolved
docs/api-inference/overview.md Outdated Show resolved Hide resolved
docs/api-inference/overview.md Outdated Show resolved Hide resolved
docs/api-inference/overview.md Outdated Show resolved Hide resolved
docs/api-inference/parameters.md Outdated Show resolved Hide resolved
docs/api-inference/parameters.md Outdated Show resolved Hide resolved
docs/api-inference/_toctree.yml Outdated Show resolved Hide resolved
osanseviero and others added 5 commits August 26, 2024 16:23
* First draft for text-to-image

* add correct code snippets

* Update docs/api-inference/tasks/text-to-image.md

Co-authored-by: Omar Sanseviero <[email protected]>

* better table?

* Generate tasks pages from script (#1386)

* init project

* first script to generate task pages

* commit generated content

* generate payload table as well

* so undecisive

* hey

* better ?

* Add image-to-image page

* template for snippets section + few things

* few things

* Update scripts/api-inference/templates/specs_headers.handlebars

Co-authored-by: Omar Sanseviero <[email protected]>

* Update scripts/api-inference/templates/specs_headers.handlebars

Co-authored-by: Omar Sanseviero <[email protected]>

* generate

* fetch inference status

---------

Co-authored-by: Omar Sanseviero <[email protected]>
@HuggingFaceDocBuilderDev

It looks like you've updated documentation related to model or dataset cards in this PR.

Some content is duplicated among the following files. Please make sure that everything stays consistent.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Given the size of the changes and the multiple PRs that got merged into it, I decided to review things in a local deployment of the docs. I opened a small PR to suggest changes: #1397.

* Filter out frozen models

* use placeholder
* show as diff

* reorder toctree

* wording update

* diff
Wauplin and others added 3 commits August 30, 2024 10:13
* Add comment header on each task page

* add huggingface.co/api/tasks
…classification (#1398)

* Add token classification

* add translation task

* add zero shot classification

* more parameters

* More tasks more tasks more tasks! (#1399)

* add ASR

* fix early stopping parameter

* regenrate

* add audio_classification

* Image classification

* Object detection

* image segementation

* unknown when we don't know

* gen

* feature extraction

* update
Wauplin added a commit to huggingface/huggingface.js that referenced this pull request Aug 30, 2024
This PR should prove useful for the ongoing work of generating
documentation pages based on the input/output specs (see
huggingface/hub-docs#1379).

In particular, I've made changes when adding new pages to the docs (PRs
huggingface/hub-docs#1398 and
huggingface/hub-docs#1399).

This PR is now ready for review.

**Changes:**
- use enums instead of `oneOf` + list of `const`
- do not rely on `"$ref":
"/inference/schemas/text2text-generation/input.json",` for Summarization
/ Translation. Makes things clearer + it's not possible to extend the
parameters which was not possible before.
- typo in `text-to-image`
- add `src_lang` and `tgt_lang` in translation params 
- use enum for `early_stopping` parameter (in common defs)
- for `audio-classification`, `automatic speech recognition`, `image
classification`, `image to image`, `object detection`:
   - mention `base64-encoded string` as input
   - mention raw data can be sent if no parameters in the JSON payload
- more descriptions in `object detection` 
- more descriptions in `image segmentation` 
- mention bytes output in `text-to-image` and `image-to-image`
* Rename all tasks '_' to '-'

* also for other urls

| User Tier | Rate Limit |
|---------------------|---------------------------|
| Unregistered Users | 1 request per hour |
Copy link
Member

Choose a reason for hiding this comment

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

this is 0 no? for Unregistered Users

client.text_classification("Today is a nice day")
```

## JavaScript
Copy link
Member

Choose a reason for hiding this comment

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

you're not using the tabs component to switch programming languages?

docs/api-inference/index.md Outdated Show resolved Hide resolved
docs/api-inference/tasks/chat-completion.md Outdated Show resolved Hide resolved
* Update getting started examples

* Move snippets above specification

* custom link for finegrained token
@osanseviero osanseviero changed the title [draft] new api docs structure New api docs structure Sep 12, 2024
osanseviero and others added 2 commits September 12, 2024 16:21
* Misc changes

* Wrap up

* Apply suggestions from code review

* generate

* Add todos to avoid forgetting about them

---------

Co-authored-by: Lucain <[email protected]>
Co-authored-by: Wauplin <[email protected]>
Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Time to merge!

@Wauplin Wauplin merged commit 1159582 into main Sep 12, 2024
1 check passed
@Wauplin Wauplin deleted the new_api_docs branch September 12, 2024 14:37
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.

7 participants