Image-Text-to-Text
Transformers
Safetensors
English
idefics2
multimodal
vision
text-generation-inference
Instructions to use HuggingFaceM4/idefics2-8b-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HuggingFaceM4/idefics2-8b-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="HuggingFaceM4/idefics2-8b-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("HuggingFaceM4/idefics2-8b-base") model = AutoModelForMultimodalLM.from_pretrained("HuggingFaceM4/idefics2-8b-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HuggingFaceM4/idefics2-8b-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HuggingFaceM4/idefics2-8b-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceM4/idefics2-8b-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/HuggingFaceM4/idefics2-8b-base
- SGLang
How to use HuggingFaceM4/idefics2-8b-base 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 "HuggingFaceM4/idefics2-8b-base" \ --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": "HuggingFaceM4/idefics2-8b-base", "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 "HuggingFaceM4/idefics2-8b-base" \ --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": "HuggingFaceM4/idefics2-8b-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use HuggingFaceM4/idefics2-8b-base with Docker Model Runner:
docker model run hf.co/HuggingFaceM4/idefics2-8b-base
Commit History
-
Update README.md
Verified signaturee37a0b3
-
Update README.md
Verified signature9661a42
-
Update README.md
Verified signature45e8045
-
tgi
f203285 -
update readme
65cea8f -
Update README.md
Verified signature2a8ad32 -
Update README.md
Verified signatureb3e370b -
red-teaming learnings in prep of `idefics2-8b-chatty` release (#4)
Verified signature- red-teaming learnings in prep of `idefics2-8b-chatty` release (bae7ac8cf965c60987328ee57f3201c6535df691) - Update README.md (d67a7d841b0a2fdf6b9de9eb34e8aac0dacaf54c) - Update README.md (7a5959cd9df4fe061253973cdfee79d64faf9732) - Update README.md (2572dc4b60659b834014b578f1875f4628714cd6)8070806
-
typo fixing
Verified signature5a909d4
-
updates
a05b1dc
-
Update README.md
Verified signature30a9a75 -
fix small typo (#2)
Verified signature- fix small typo (c14f48116ba8c527e05d70216058166175ae9e38) Co-authored-by: Moritz Laurer <MoritzLaurer@users.noreply.huggingface.co>4b1a6e0 -
Update README.md
Verified signature4ceecdb -
update readme
042af7d -
name change
eea1236 -
Update README.md
Verified signature9dede18 -
update table
Verified signature55bae09 -
Update README.md
Verified signature27780fc -
awq versions
Verified signaturebaf1ac8 -
tips of memory gpu
Verified signatureb7e1543 -
comment out trl ft for now
Verified signature791b16d -
tiny fix with connector update
6e9baf5
-
Upload folder using huggingface_hub
Verified signature1cb5729 -
some fixes
Verified signatureaaddfc9
-
Update README.md
Verified signature54c6ef4 -
generation_config with bad_words_ids
1ed46b5 -
`eos_token_id`
Verified signature65215b0
-
even more friendly
dff8ac8 -
shorter
2570852 -
shorter
907179c -
br
6059b95 -
oops
c69b53c -
no br
1e924a4 -
add links
df35ec4 -
hop
dcb5a04 -
Typo (#1)
Verified signature- Typo (0043d5983d4ca2bcbebcaaf7f192fae801f3f8e3) Co-authored-by: Hugo Laurençon <HugoLaurencon@users.noreply.huggingface.co>13bf038 -
Update README.md
Verified signature7b9186b
-
hop
83de4ee -
the cauldron
f295467 -
model card with the missing todos
70c103e
-
fix
87a4394 -
idefics2-8b-base
3faf10a
-
initial commit
Verified signature08aa780