Instructions to use MBZUAI/GLaMM-RegCap-VG with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MBZUAI/GLaMM-RegCap-VG with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MBZUAI/GLaMM-RegCap-VG")# Load model directly from transformers import AutoProcessor, AutoModelForCausalLM processor = AutoProcessor.from_pretrained("MBZUAI/GLaMM-RegCap-VG") model = AutoModelForCausalLM.from_pretrained("MBZUAI/GLaMM-RegCap-VG") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use MBZUAI/GLaMM-RegCap-VG with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MBZUAI/GLaMM-RegCap-VG" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MBZUAI/GLaMM-RegCap-VG", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MBZUAI/GLaMM-RegCap-VG
- SGLang
How to use MBZUAI/GLaMM-RegCap-VG 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 "MBZUAI/GLaMM-RegCap-VG" \ --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": "MBZUAI/GLaMM-RegCap-VG", "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 "MBZUAI/GLaMM-RegCap-VG" \ --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": "MBZUAI/GLaMM-RegCap-VG", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MBZUAI/GLaMM-RegCap-VG with Docker Model Runner:
docker model run hf.co/MBZUAI/GLaMM-RegCap-VG
| { | |
| "_name_or_path": "trained_checkpoints/exp1_pretrain_v1.5_spi_module_gs_4488", | |
| "architectures": [ | |
| "LISAForCausalLM" | |
| ], | |
| "bbox_token_idx": 32002, | |
| "bos_token_id": 1, | |
| "eos_token_id": 2, | |
| "freeze_mm_mlp_adapter": true, | |
| "freeze_mm_vision_resampler": false, | |
| "hidden_act": "silu", | |
| "hidden_size": 4096, | |
| "image_aspect_ratio": "square", | |
| "image_grid_pinpoints": null, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 11008, | |
| "max_length": 4096, | |
| "max_position_embeddings": 4096, | |
| "mm_hidden_size": 1024, | |
| "mm_projector_type": "mlp2x_gelu", | |
| "mm_resampler_type": null, | |
| "mm_use_im_patch_token": false, | |
| "mm_use_im_start_end": true, | |
| "mm_vision_select_feature": "patch", | |
| "mm_vision_select_layer": -2, | |
| "mm_vision_tower": "openai/clip-vit-large-patch14-336", | |
| "model_type": "llava", | |
| "num_attention_heads": 32, | |
| "num_hidden_layers": 32, | |
| "num_key_value_heads": 32, | |
| "num_level_reg_features": 4, | |
| "out_dim": 256, | |
| "pad_token_id": 0, | |
| "pretrain_mm_mlp_adapter": null, | |
| "pretraining_tp": 1, | |
| "rms_norm_eps": 1e-05, | |
| "rope_scaling": null, | |
| "tie_word_embeddings": false, | |
| "torch_dtype": "bfloat16", | |
| "train_mask_decoder": true, | |
| "transformers_version": "4.28.0.dev0", | |
| "tune_mm_mlp_adapter": false, | |
| "tune_mm_vision_resampler": false, | |
| "unfreeze_mm_vision_tower": false, | |
| "use_cache": false, | |
| "use_mm_proj": true, | |
| "vision_tower": "openai/clip-vit-large-patch14-336", | |
| "vocab_size": 32007, | |
| "with_region": true | |
| } | |