Instructions to use FreedomIntelligence/ALLaVA-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FreedomIntelligence/ALLaVA-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FreedomIntelligence/ALLaVA-3B", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("FreedomIntelligence/ALLaVA-3B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FreedomIntelligence/ALLaVA-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FreedomIntelligence/ALLaVA-3B" # 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-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/FreedomIntelligence/ALLaVA-3B
- SGLang
How to use FreedomIntelligence/ALLaVA-3B 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-3B" \ --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-3B", "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-3B" \ --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-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use FreedomIntelligence/ALLaVA-3B with Docker Model Runner:
docker model run hf.co/FreedomIntelligence/ALLaVA-3B
Delete constants.py with huggingface_hub
Browse files- constants.py +0 -13
constants.py
DELETED
|
@@ -1,13 +0,0 @@
|
|
| 1 |
-
CONTROLLER_HEART_BEAT_EXPIRATION = 30
|
| 2 |
-
WORKER_HEART_BEAT_INTERVAL = 15
|
| 3 |
-
|
| 4 |
-
LOGDIR = "."
|
| 5 |
-
|
| 6 |
-
# Model Constants
|
| 7 |
-
IGNORE_INDEX = -100
|
| 8 |
-
IMAGE_TOKEN_INDEX = -200
|
| 9 |
-
DEFAULT_IMAGE_TOKEN = "<image>"
|
| 10 |
-
DEFAULT_IMAGE_PATCH_TOKEN = "<im_patch>"
|
| 11 |
-
DEFAULT_IM_START_TOKEN = "<im_start>"
|
| 12 |
-
DEFAULT_IM_END_TOKEN = "<im_end>"
|
| 13 |
-
IMAGE_PLACEHOLDER = "<image-placeholder>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|