Instructions to use FreedomIntelligence/LongLLaVA-53B-A13B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FreedomIntelligence/LongLLaVA-53B-A13B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="FreedomIntelligence/LongLLaVA-53B-A13B", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("FreedomIntelligence/LongLLaVA-53B-A13B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FreedomIntelligence/LongLLaVA-53B-A13B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FreedomIntelligence/LongLLaVA-53B-A13B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FreedomIntelligence/LongLLaVA-53B-A13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/FreedomIntelligence/LongLLaVA-53B-A13B
- SGLang
How to use FreedomIntelligence/LongLLaVA-53B-A13B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "FreedomIntelligence/LongLLaVA-53B-A13B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FreedomIntelligence/LongLLaVA-53B-A13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "FreedomIntelligence/LongLLaVA-53B-A13B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FreedomIntelligence/LongLLaVA-53B-A13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use FreedomIntelligence/LongLLaVA-53B-A13B with Docker Model Runner:
docker model run hf.co/FreedomIntelligence/LongLLaVA-53B-A13B
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,108 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
+

|
| 5 |
+
|
| 6 |
+
<p align="center">
|
| 7 |
+
📃 <a href="" target="_blank">Paper</a> • 🌐 <a href="" target="_blank">Demo</a> • 🤗 <a href="https://huggingface.co/FreedomIntelligence/LongLLaVA" target="_blank">LongLLaVA</a>
|
| 8 |
+
</p>
|
| 9 |
+
|
| 10 |
+

|
| 11 |
+
|
| 12 |
+
## 🌈 Update
|
| 13 |
+
|
| 14 |
+
* **[2024.09.05]** LongLLaVA repo is published!🎉 The Code will
|
| 15 |
+
|
| 16 |
+
## Architecture
|
| 17 |
+
|
| 18 |
+
<details>
|
| 19 |
+
<summary>Click to view the architecture image</summary>
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
|
| 23 |
+
</details>
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
## Results
|
| 27 |
+
|
| 28 |
+
<details>
|
| 29 |
+
<summary>Click to view the Results</summary>
|
| 30 |
+
|
| 31 |
+
- Main Results
|
| 32 |
+

|
| 33 |
+
- Diagnostic Results
|
| 34 |
+

|
| 35 |
+
- Video-NIAH
|
| 36 |
+

|
| 37 |
+
|
| 38 |
+
</details>
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
## Results reproduction
|
| 43 |
+
|
| 44 |
+
### Data DownLoad and Construction
|
| 45 |
+
|
| 46 |
+
<details>
|
| 47 |
+
<summary>Dataset Taxonomy</summary>
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
|
| 51 |
+
</details>
|
| 52 |
+
|
| 53 |
+
<details>
|
| 54 |
+
<summary>Dataset DownLoading and Construction</summary>
|
| 55 |
+
|
| 56 |
+
> Coming Soon~
|
| 57 |
+
|
| 58 |
+
</details>
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
### Training
|
| 62 |
+
|
| 63 |
+
> Coming Soon~
|
| 64 |
+
|
| 65 |
+
- Stage I: Single-image Alignment.
|
| 66 |
+
```bash
|
| 67 |
+
bash Pretrain.sh
|
| 68 |
+
```
|
| 69 |
+
- Stage II: Single-image Instruction-tuning.
|
| 70 |
+
```bash
|
| 71 |
+
bash SingleImageSFT.sh
|
| 72 |
+
```
|
| 73 |
+
- Stage III: Multi-image Instruction-tuning.
|
| 74 |
+
```bash
|
| 75 |
+
bash MultiImageSFT.sh
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
### Evaluation
|
| 79 |
+
|
| 80 |
+
> Coming Soon~
|
| 81 |
+
|
| 82 |
+
```bash
|
| 83 |
+
bash Eval.sh
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
## TO DO
|
| 87 |
+
|
| 88 |
+
- [ ] Release Model Evalation Code
|
| 89 |
+
- [ ] Release Data Construction Code
|
| 90 |
+
- [ ] Release Model Training Code
|
| 91 |
+
|
| 92 |
+
## Acknowledgement
|
| 93 |
+
|
| 94 |
+
- [LLaVA](https://github.com/haotian-liu/LLaVA): Visual Instruction Tuning (LLaVA) built towards GPT-4V level capabilities and beyond.
|
| 95 |
+
|
| 96 |
+
## Citation
|
| 97 |
+
|
| 98 |
+
```
|
| 99 |
+
@misc{wang2024longllavascalingmultimodalllms,
|
| 100 |
+
title={LongLLaVA: Scaling Multi-modal LLMs to 1000 Images Efficiently via Hybrid Architecture},
|
| 101 |
+
author={Xidong Wang and Dingjie Song and Shunian Chen and Chen Zhang and Benyou Wang},
|
| 102 |
+
year={2024},
|
| 103 |
+
eprint={2409.02889},
|
| 104 |
+
archivePrefix={arXiv},
|
| 105 |
+
primaryClass={cs.CL},
|
| 106 |
+
url={https://arxiv.org/abs/2409.02889},
|
| 107 |
+
}
|
| 108 |
+
```
|