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

Allow LoRA adapter revision in server launcher #2592

Closed
wants to merge 2 commits into from

Conversation

teamclouday
Copy link
Contributor

What does this PR do?

I was trying to load an adapter from hub with specific revision. The document about revision is missing but by checking the code there's support in the format of adapter_id=path@revision. Details can be found in parse_lora_adapters method and test code.

However, setting the revision doesn't work because the launcher will try to download the model first, and it's ignoring revision. Therefore I'm making this PR hoping to enable adapter revision. Also added documentation of the adapter revision format.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@teamclouday
Copy link
Contributor Author

Also wonder if there exists implementation to dynamically download the lora adapter when being requested from API

@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.

@drbh
Copy link
Collaborator

drbh commented Oct 2, 2024

Hi @teamclouday thank you for this contribution and fix! I've just merged the changes after rerunning CI in this PR #2602. Thank you!

Regarding downloading the adapter at request time - this is currently out of scope for TGI because we aim to statically allocate memory at startup. Currently we avoid any dynamic allocations at runtime. Downloading an adapter and loading after startup would violate this constraint and will likely not be supported.

@drbh drbh closed this Oct 2, 2024
@teamclouday
Copy link
Contributor Author

Thank you! That makes sense!

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.

3 participants