Skip to content

fix: add merge-lora arg for model id #2788

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

Merged
merged 1 commit into from
Dec 2, 2024
Merged

Conversation

drbh
Copy link
Collaborator

@drbh drbh commented Nov 29, 2024

This PR fixes an issue when loading a lora adapter via --model-id and not --lora-adapters.

context
Prior to multi lora, if an adapter was specified as the model id, TGI would automatically merge the base model with the adapter weights and resave the merged model under the adapter id. Multi-lora requires the weights to be unmerged - so it can dynamically apply the adapter at runtime. If the adapter is mutated/merged than it no longer can be used with multi-lora. Due to this fact, merging by default was disabled with multi lora. In order to merge weights a --merge-lora flag must be used when calling download-weights. This PR removes that requirement and will automatically merge the weights if no adapters are supplies. NOTE*** once merged the adapter will no longer be useable with mutli-lora (and you'll need to redownload the adapter only)

@Narsil Narsil merged commit 2c74c55 into main Dec 2, 2024
9 of 12 checks passed
@Narsil Narsil deleted the attempt-merge-when-no-base-model branch December 2, 2024 04:52
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.

2 participants