LLaMA2-Accessory: An Open-source Toolkit for LLM Development 🚀
<p align="center"> <img src="docs/logo.png" width="90%"/> <br> </p>
🚀LLaMA2-Accessory is an open-source toolkit for pre-training, fine-tuning and deployment of Large Language Models (LLMs) and mutlimodal LLMs. This repo is mainly inherited from LLaMA-Adapter with more advanced features.🧠
News
- [2023.08.05] We release the multimodel fine-tuning codes and checkpoints🔥🔥🔥
- [2023.07.23] Initial release 📌
Features
-
💡Support More Datasets and Tasks
- 🎯 Pre-training with RefinedWeb and StarCoder.
- 📚 Single-modal fine-tuning with Alpaca, ShareGPT, LIMA, WizardLM, UltraChat and MOSS.
- 🌈 Multi-modal fine-tuning with image-text pairs (LAION, COYO and more), interleaved image-text data (MMC4 and OBELISC) and visual instruction data (LLaVA, Shrika, Bard)
- 🔧 LLM for API Control (GPT4Tools and Gorilla).
-
⚡Efficient Optimization and Deployment
- 🚝 Parameter-efficient fine-tuning with Zero-init Attenion and Bias-norm Tuning.
- 💻 Fully Sharded Data Parallel (FSDP), Flash Attention 2 and QLoRA.
-
🏋️♀️Support More Visual Encoders and LLMs
Setup
:gear: For environment installation, please refer to docs/install.md.
Model Usage
:robot: Instructions for model training, inference, and fine-tuning are available in docs/pretrain.md, docs/inference.md, and docs/finetune.md, respectively.
Frequently Asked Questions (FAQ)
:question: Encountering issues or have further questions? Find answers to common inquiries here. We're here to assist you!
Demos
- Instruction-tuned LLaMA2: alpaca & gorilla.
- Chatbot LLaMA2: dialog_sharegpt & dialog_lima & llama2-chat.
- Multimodal LLaMA2: in-context & alpacaLlava_llamaQformerv2_13b
<img src="./docs/examples/finetune/mm/demo1.png" width="80%" /> <img src="./docs/examples/finetune/mm/demo2.png" width="80%" /> <img src="./docs/examples/finetune/mm/demo3.png" width="80%" /> <img src="./docs/examples/finetune/mm/demo4.png" width="80%" /> <img src="./docs/examples/finetune/mm/demo5.png" width="80%" />
Core Contributors
Chris Liu, Ziyi Lin, Guian Fang, Jiaming Han, Yijiang Liu, Renrui Zhang
Project Leader
Peng Gao, Wenqi Shao, Shanghang Zhang
Hiring Announcement
🔥 We are hiring interns, postdocs, and full-time researchers at the General Vision Group, Shanghai AI Lab, with a focus on multi-modality and vision foundation models. If you are interested, please contact gaopengcuhk@gmail.com.
Citation
If you find our code and paper useful, please kindly cite:
@article{zhang2023llamaadapter,
title = {LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attention},
author={Zhang, Renrui and Han, Jiaming and Liu, Chris and Gao, Peng and Zhou, Aojun and Hu, Xiangfei and Yan, Shilin and Lu, Pan and Li, Hongsheng and Qiao, Yu},
journal={arXiv preprint arXiv:2303.16199},
year={2023}
}
@article{gao2023llamaadapterv2,
title = {LLaMA-Adapter V2: Parameter-Efficient Visual Instruction Model},
author={Gao, Peng and Han, Jiaming and Zhang, Renrui and Lin, Ziyi and Geng, Shijie and Zhou, Aojun and Zhang, Wei and Lu, Pan and He, Conghui and Yue, Xiangyu and Li, Hongsheng and Qiao, Yu},
journal={arXiv preprint arXiv:2304.15010},
year={2023}
}
Acknowledgement
-
@OpenGVLab for LLaMA-Adapter <details><summary>Show More</summary>
-
@facebookresearch for ImageBind & LIMA
-
@tloen for alpaca-lora
-
@NVIDIA for apex & Megatron-LM
-
@haotian-liu for LLaVA
-
@huggingface for peft & OBELISC
-
@Lightning-AI for lit-gpt & lit-llama
-
@ShishirPatil for gorilla
-
@OpenLMLab for MOSS
-
@salesforce for LAVIS
-
@microsoft for DeepSpeed
-
@declare-lab for flacuna
License
Llama 2 is licensed under the LLAMA 2 Community License, Copyright (c) Meta Platforms, Inc. All Rights Reserved.