Instructions to use FreedomIntelligence/ALLaVA-StableLM2-1_6B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FreedomIntelligence/ALLaVA-StableLM2-1_6B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FreedomIntelligence/ALLaVA-StableLM2-1_6B", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("FreedomIntelligence/ALLaVA-StableLM2-1_6B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FreedomIntelligence/ALLaVA-StableLM2-1_6B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FreedomIntelligence/ALLaVA-StableLM2-1_6B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FreedomIntelligence/ALLaVA-StableLM2-1_6B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/FreedomIntelligence/ALLaVA-StableLM2-1_6B
- SGLang
How to use FreedomIntelligence/ALLaVA-StableLM2-1_6B 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/ALLaVA-StableLM2-1_6B" \ --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/ALLaVA-StableLM2-1_6B", "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/ALLaVA-StableLM2-1_6B" \ --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/ALLaVA-StableLM2-1_6B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use FreedomIntelligence/ALLaVA-StableLM2-1_6B with Docker Model Runner:
docker model run hf.co/FreedomIntelligence/ALLaVA-StableLM2-1_6B
Update README.md
Browse files
README.md
CHANGED
|
@@ -89,11 +89,11 @@ See [here](https://github.com/FreedomIntelligence/ALLaVA/tree/main?tab=readme-ov
|
|
| 89 |
## 🏋️♂️ Training
|
| 90 |
|
| 91 |
### Data
|
| 92 |
-
<
|
| 93 |
<img src="training_datasets_by_stage.jpg" width = "640" alt="training_datasets" align=center />
|
| 94 |
-
</div>
|
| 95 |
|
| 96 |
-
ALLaVA uses
|
| 97 |
|
| 98 |
|
| 99 |
### Code
|
|
@@ -110,7 +110,7 @@ These two models share the same PT procedure. -->
|
|
| 110 |
### Hyperparameters
|
| 111 |
|
| 112 |
| Global Batch Size| ZeRO Stage| Optimizer | Max LR| Min LR | Scheduler | Weight decay |
|
| 113 |
-
| ---: | ---: |--:| ---: | ---: | ---: | ---: |
|
| 114 |
| 256 (PT) / 128 (FT) | 1| AdamW | 2e-5 | 2e-6 | CosineAnnealingWarmRestarts | 0 |
|
| 115 |
|
| 116 |
The LM backbone, projector are trainable, while the vision encoder is kept frozen.
|
|
|
|
| 89 |
## 🏋️♂️ Training
|
| 90 |
|
| 91 |
### Data
|
| 92 |
+
<div align=center>
|
| 93 |
<img src="training_datasets_by_stage.jpg" width = "640" alt="training_datasets" align=center />
|
| 94 |
+
</div>
|
| 95 |
|
| 96 |
+
ALLaVA uses 1.0M and 1.5M data for PT. and FT., respectively.
|
| 97 |
|
| 98 |
|
| 99 |
### Code
|
|
|
|
| 110 |
### Hyperparameters
|
| 111 |
|
| 112 |
| Global Batch Size| ZeRO Stage| Optimizer | Max LR| Min LR | Scheduler | Weight decay |
|
| 113 |
+
| ---: | ---: |--:| ---: | ---: | ---: | ---: |
|
| 114 |
| 256 (PT) / 128 (FT) | 1| AdamW | 2e-5 | 2e-6 | CosineAnnealingWarmRestarts | 0 |
|
| 115 |
|
| 116 |
The LM backbone, projector are trainable, while the vision encoder is kept frozen.
|