fix: add merge-lora arg for model id #2788
Open
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.
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 callingdownload-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)