Multi-LoRAs is a LLM toolkit that can simultaneously load multiple LoRA modules and automatically switch to the appropriate combination of LoRA modules based on user queries to generate the best answer. It includes tools such as extracting LoRA modules from efficiently parameters fine-tuning models, merging base models with LoRA models, and routing multiple LoRA models.
Project description
Multi-LoRAs
Multi-LoRAs is a LLM toolkit that can simultaneously load multiple LoRA modules and automatically switch to the appropriate combination of LoRA modules based on user queries to generate the best answer. It includes tools such as extracting LoRA modules from efficiently parameters fine-tuning models, merging base models with LoRA models, and routing multiple LoRA models.
Tools:
- Extract the LoRA module from a model that has undergone efficient parameter fine-tuning.
- Tool for merging LoRA module into the base model.
- Multi LoRAs router (Under development)
Install
pip install multi_loras
# - or -
pip install git+https://github.com/uukuguy/multi_loras.git
Quick Start
Extract LoRA model from a model.
python -m multi_loras \
extract_lora \
--base_model_name_or_path ${BASE_MODEL_PATH} \
--tuned_model_name_or_path ${TUNED_MODEL_PATH} \
--save_path ${LORA_SAVE_PATH} \
--bf16 \
--bits 4 \
--lora_r 64
Merge the extracted LoRA model with the base model.
python -m multi_loras \
merge_lora \
--base_model_name_or_path ${BASE_MODEL_PATH} \
--lora_model_path ${LORA_SAVE_PATH} \
--merged_model_name_or_path ${TASK_MODEL_PATH}
References
- Gradio GUI for Kohya’s Stable Diffusion Trainer
networks/extract_lora_from_models.py networks/merge_lora.py networks/resize_lora.py network/lora.py network/lora_fa.py network/dylora.py
- LoRA for Text-to-Image
lora_diffusion/cli_svd.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for multi_loras-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b79ff971fd2d1d7ebded84f58ffbaf1d0601ea219c01432f58004538ed28c408 |
|
MD5 | 1f349a74adaf3ce36522f6730020dce8 |
|
BLAKE2b-256 | f97cad7f43fe688303b03f5fc13f48f383e7dcf1f5a154e736bd58894b2b875b |