-
Couldn't load subscription status.
- Fork 42
[InferenceSnippet] do not fail entirely if snippets did not work #574
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR ensures that errors during inference snippet generation do not block documentation updates by catching exceptions and returning empty snippets. Key changes include:
- Adding a new interface (InferenceProviderMappingEntry) to support mapping information.
- Creating a helper function (getInferenceSnippetsOrEmpty) that wraps snippet retrieval in a try-catch.
- Updating code calls to use the new helper function, preventing complete failure on snippet generation failures.
Comments suppressed due to low confidence (1)
kit/src/lib/InferenceSnippet/InferenceSnippet.svelte:76
- Add a brief comment explaining the purpose of getInferenceSnippetsOrEmpty(), particularly why errors are caught and an empty array is returned.
function getInferenceSnippetsOrEmpty(
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Currently `InferenceProviderMappingEntry` is defined in a module that is not exported. This PR moves it to the `types.ts` module for better reusability (will be useful for huggingface/doc-builder#574 (comment))
…lder into do-not-fail-on-error
|
@mishig25 PR is ready for review |
Currently doc-builder fails on Inference Provider docs with:
This is due to provider Replicate having a
automatic-speech-recognitionmodel listed even though the JS / Python clients do not support it (and therefore we cannot generate the snippets). Instead of failing entirely it would be best to warn on error and continue. This allows other snippets to be correctly updated.Note: a solution in parallel is to unlist the failing model on Replicate side. I already pinged them on Slack about that but in any case, we should not block doc updates just because of a mistake from a provider.