-
Notifications
You must be signed in to change notification settings - Fork 374
[Inference doc] Next gen inference snippets #1643
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
Conversation
|
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. |
|
Handled by huggingface/doc-builder#549 see example: #1656 |
|
hmm https://moon-ci-docs.huggingface.co/docs/api-inference/pr_1643/en/index has not been updated no? |
It's now under https://moon-ci-docs.huggingface.co/docs/inference-providers/pr_1643/en/index (but in general this PR is not ready, I finishing it up) |
|
@julien-c @gary149 @hanouticelina @SBrandeis PR is finally ready for review. Best way to review is to go on https://moon-ci-docs.huggingface.co/docs/inference-providers/pr_1643/en/tasks/index |
| <InferenceSnippet | ||
| pipeline=automatic-speech-recognition | ||
| providersMapping={ {"fal-ai":{"modelId":"openai/whisper-large-v3","providerModelId":"fal-ai/whisper"},"hf-inference":{"modelId":"openai/whisper-large-v3-turbo","providerModelId":"openai/whisper-large-v3-turbo"}} } | ||
| /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so in the end you don't embed the full snippets in the markdown. Correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we still need to regenerate the .md from time to time to pick up the mapping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes exactly. If we want we can still have an .md export for llms but not for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so in the end you don't embed the full snippets in the markdown. Correct?
inference snippets strings are directly coming from https://github.com/huggingface/huggingface.js (single source of truth)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ I think that statement does not hold anymore - we moved snippets code to moon-landing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a confusion here 😬
Inference snippets are indeed located in huggingface.js/inference (or I'm not aware of the change) and providers mapping is on the Hub => and pulled from the Hub by the script in this PR to make sure we always get up-to-date models in the docs => done in CI once a day
So all good, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I've mistaken 'snippets' and 'widgets' - my bad!
| </js> | ||
|
|
||
| </inferencesnippet> | ||
| No snippet available for this task. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's no warm hf-inference for this seminal task? Que pena!!

How to review
Go to https://moon-ci-docs.huggingface.co/docs/inference-providers/pr_1643/en/tasks/index
Description
Opening this PR as a draft as it'll requires some deeper changes in doc-builder cc @julien-c @gary149 @mishig25 @SBrandeis @hanouticelina
This PR updates the script to generate the tasks pages of the Inference API docs (e.g. text-to-image page). The short-term goal is to revamp the "Inference API" docs as an "Inference Providers" one, making them more provider-centric. With this PR, each task page will have
<inferencesnippets>tag to have an interface similar to the one on the model pageWhat I did in this PR is to generate the snippets and serialize them inside some
<snippet provider="..." language="..." client="...">tags. This is where doc-builder should be updated to take them into account.EDIT: using the new
</InferenceSnippet>svelte component from huggingface/doc-builder#549 (thanks @mishig25!)