- Notifications
You must be signed in to change notification settings - Fork539
Bytez Model Provider Integration#1787
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
inf3rnus wants to merge7 commits intohuggingface:mainChoose a base branch frominf3rnus:09-0-25-bytez-integration
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Open
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading.Please reload this page.
Hey there all,
We'reBytez, and we're the largest inference provider on the internet! (We offer inference for 170k+ models.)
We're stuck on step 3 of the integration guide presumably because we need to be added as a provider. (We are unable to use the model mapping api because we don't exist as a provider on your backend.)
This PR allows for Bytez to be used as an inference provider (
bytez-ai).For the most part, changes are isolated to just the Bytez code with the exception of 5 places:
packages/inference/src/tasks/audio/audioClassification.tspackages/inference/src/tasks/cv/imageClassification.tspackages/inference/src/tasks/cv/objectDetection.tspackages/inference/src/tasks/cv/imageToText.tspackages/inference/src/providers/hf-inference.tsThe first three have this simple addition to allow for the flexibility to prepare a payload async, which better aligns with how the other tasks are setup.
I'd have dug deeper to bring greater consistency for all of the tasks, but opted for these simple adjustments to see what you guys have to say before making any major changes.
The final task change,
packages/inference/src/tasks/cv/imageToText.tsfollows the same pattern, but also changes the passing of the response to this:It used to be:
There isn't a hook higher up in the call stack (AFAIK) for us to adapt our response to look like an array, so I've opted for this.
To ensure that the existing
hf-inferenceprovider code still works, I've modified theHFInferenceImageToTextTaskto destructure the array internally, which to me seems more consistent with the general pattern, where the raw response is untouched until it is passed to thegetResponse()handler.Please let us know if we need to do anything else! 🙏
Also, as a question, is it normal for us to not be able to hit
https://huggingface.co/api/partners/bytez-ai/modelsuntil this PR is accepted and we are on aTeam/Enterpriseplan? FWIW we are on aTeam/Enterpriseplan.If so, we'd like to help you update your docs to make this more explicit!
We look forward to integrating!
Long live huggingface! 🤗