Image-Text-to-Text
Transformers
Safetensors
Mobilint
mobilint-d1
feature-extraction
custom_code
npu
decision
system-one
liquid
Instructions to use mobilint/d1-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mobilint/d1-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="mobilint/d1-3B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mobilint/d1-3B", trust_remote_code=True, device_map="auto") - Mobilint
How to use mobilint/d1-3B with Mobilint:
# pip install mblt-model-zoo from mblt_model_zoo.vision import MBLT_Engine model = MBLT_Engine( model_cls="d1-3B", model_type="DEFAULT", model_path="", core_mode="global8", ) try: image = model.preprocess("path/to/image.jpg") output = model(image) result = model.postprocess(output) finally: model.dispose() - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mobilint/d1-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mobilint/d1-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mobilint/d1-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mobilint/d1-3B
- SGLang
How to use mobilint/d1-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 "mobilint/d1-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": "mobilint/d1-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 "mobilint/d1-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": "mobilint/d1-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mobilint/d1-3B with Docker Model Runner:
docker model run hf.co/mobilint/d1-3B
Download proxy_d1.py from mobilint/d1-3B: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/mobilint/d1-3B/resolve/main/proxy_d1.py
- Command line
-
hf download hf://mobilint/d1-3B/proxy_d1.py
-
curl -L -o proxy_d1.py https://huggingface.co/mobilint/d1-3B/resolve/main/proxy_d1.py
1.38 kB
| """Proxy exports for the Mobilint D1 Hub repository.""" | |
| _MISSING = { | |
| "transformers_mblt", | |
| "transformers_mblt.models", | |
| "transformers_mblt.models.d1", | |
| "mblt_model_zoo", | |
| "mblt_model_zoo.hf_transformers", | |
| "mblt_model_zoo.hf_transformers.models", | |
| "mblt_model_zoo.hf_transformers.models.d1", | |
| } | |
| try: | |
| from transformers_mblt.models.d1.configuration_d1 import ( | |
| MobilintD1Config, | |
| ) | |
| from transformers_mblt.models.d1.modeling_d1 import ( | |
| MobilintD1Model, | |
| ) | |
| except ModuleNotFoundError as exc: | |
| # No transformers-mblt, or a release from before D1 (0.7.2 and earlier). | |
| if exc.name not in _MISSING: | |
| raise | |
| # Hub repositories are shared with mblt-model-zoo, which exposes the same classes under its legacy path. | |
| try: | |
| from mblt_model_zoo.hf_transformers.models.d1.configuration_d1 import ( | |
| MobilintD1Config, | |
| ) | |
| from mblt_model_zoo.hf_transformers.models.d1.modeling_d1 import ( | |
| MobilintD1Model, | |
| ) | |
| except ModuleNotFoundError as legacy_exc: | |
| if legacy_exc.name not in _MISSING: | |
| raise | |
| raise ImportError( | |
| "This model requires transformers-mblt 0.8.0 or later, which adds D1. Please run: " | |
| "pip install -U 'transformers-mblt>=0.8.0'" | |
| ) from legacy_exc | |
| __all__ = ["MobilintD1Config", "MobilintD1Model"] | |