Instructions to use Molbap/molmo-hf-7B-D with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Molbap/molmo-hf-7B-D with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Molbap/molmo-hf-7B-D") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("Molbap/molmo-hf-7B-D", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Molbap/molmo-hf-7B-D with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Molbap/molmo-hf-7B-D" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Molbap/molmo-hf-7B-D", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Molbap/molmo-hf-7B-D
- SGLang
How to use Molbap/molmo-hf-7B-D 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 "Molbap/molmo-hf-7B-D" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Molbap/molmo-hf-7B-D", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Molbap/molmo-hf-7B-D" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Molbap/molmo-hf-7B-D", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Molbap/molmo-hf-7B-D with Docker Model Runner:
docker model run hf.co/Molbap/molmo-hf-7B-D
File size: 1,541 Bytes
2a5ac63 421084f aa488ba 421084f 2a5ac63 4a3a9a1 2a5ac63 421084f 2a5ac63 421084f 2a5ac63 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | {
"auto_map": {
"AutoImageProcessor": "image_preprocessing_molmo.MolmoImageProcessor",
"AutoProcessor": "preprocessing_molmo.MolmoProcessor"
},
"base_image_input_size": [
336,
336
],
"crop_patches": 24,
"crop_size": 336,
"crop_window_patches": 16,
"crop_window_size": 224,
"data_format": "channels_first",
"default_to_square": true,
"device": "cuda:2",
"do_center_crop": null,
"do_convert_rgb": true,
"do_normalize": true,
"do_pad": true,
"do_rescale": true,
"do_resize": true,
"do_split_into_crops": true,
"image_column_token": "<im_col>",
"image_end_token": "<im_end>",
"image_mean": [
0.48145466,
0.4578275,
0.40821073
],
"image_padding_mask": true,
"image_patch_size": 14,
"image_patch_token": "<im_patch>",
"image_processor_type": "MolmoImageProcessorFast",
"image_start_token": "<im_start>",
"image_std": [
0.26862954,
0.26130258,
0.27577711
],
"image_token_length_h": 12,
"image_token_length_w": 12,
"input_data_format": null,
"max_crops": 12,
"max_num_crops": 12,
"overlap_margins": [
4,
4
],
"padding_mode": "constant",
"padding_value": 1.0,
"patches_per_image_height": 24,
"patches_per_image_width": 24,
"processor_class": "MolmoProcessor",
"resample": 2,
"rescale_factor": 0.00392156862745098,
"return_tensors": null,
"size": {
"height": 336,
"width": 336
},
"tokens_per_image": 144,
"tokens_per_image_height": 12,
"tokens_per_image_width": 12,
"total_margin_pixels": 112
}
|