-
Notifications
You must be signed in to change notification settings - Fork 701
[Inference Providers] Support for LoRAs #3005
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
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 haven't tested locally yet but left some high-level comments related to naming + structure to match as much as possible the JS counterpart.
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. |
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.
Looking forward to this!
) Following @Wauplin 's comment [here](huggingface/huggingface_hub#3005 (comment)) Pre-requisite: merge and deploy [this internal PR first](huggingface-internal/moon-landing#13498)
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.
lgtm
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.
All good! Pre-approving but still curious about this hardcoded model_name
Co-authored-by: Lucain <[email protected]>
Co-authored-by: Lucain <[email protected]>
i'm merging, CI is red for unrelated reasons (hub-ci seems to be down) |
This work mirrors the PR in the js client (see huggingface.js#1347).
This PR introduces the support of LoRAs for fal-ai, this should not be merged until the server-side PR is merged (private).
Changes
_prepare_mapped_model
to return aProviderMappingInfo
object. This object returns the provider id, the hf model id (optional) and the lora weights path (optional) that is expected to be sent in the payload._prepare_payload_as_dict
and_prepare_payload_as_bytes
signatures to accept aProviderMappingInfo
object as an argument.the logic is implemented within the
TaskProviderHelper
base class, to avoid duplicating similar logic when we support LoRAs for the other providers. Note that LoRAs can also be used with other tasks liketext-to-video
as instance.