Image-Text-to-Text
Transformers
Safetensors
lfm2-vl
Generated from Trainer
sft
trl
conversational
custom_code
Instructions to use davanstrien/lfm2-vl-iconclass with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use davanstrien/lfm2-vl-iconclass with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="davanstrien/lfm2-vl-iconclass", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMultimodalLM model = AutoModelForMultimodalLM.from_pretrained("davanstrien/lfm2-vl-iconclass", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use davanstrien/lfm2-vl-iconclass with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "davanstrien/lfm2-vl-iconclass" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "davanstrien/lfm2-vl-iconclass", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/davanstrien/lfm2-vl-iconclass
- SGLang
How to use davanstrien/lfm2-vl-iconclass 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 "davanstrien/lfm2-vl-iconclass" \ --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": "davanstrien/lfm2-vl-iconclass", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "davanstrien/lfm2-vl-iconclass" \ --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": "davanstrien/lfm2-vl-iconclass", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use davanstrien/lfm2-vl-iconclass with Docker Model Runner:
docker model run hf.co/davanstrien/lfm2-vl-iconclass
Commit History
-
Upload processor
Verified signatureee8e8a4 -
Model save
Verified signaturefaa7052 -
Training in progress, step 2194
Verified signatureb50e241 -
Training in progress, step 2150
Verified signaturee60db21 -
Training in progress, step 2100
Verified signatureb61e6f9 -
Training in progress, step 2050
Verified signature411807a -
Training in progress, step 2000
Verified signature4c8f916 -
Training in progress, step 1950
Verified signaturea1dc8d1 -
Training in progress, step 1900
Verified signaturebfc9697 -
Training in progress, step 1850
Verified signature50eb91d -
Training in progress, step 1800
Verified signaturec8d88a3 -
Training in progress, step 1750
Verified signature5ac96af -
Training in progress, step 1700
Verified signature09fd02b -
Training in progress, step 1650
Verified signature04499df -
Training in progress, step 1600
Verified signaturee02c221 -
Training in progress, step 1550
Verified signature28c2a54 -
Training in progress, step 1500
Verified signature7bf19f7
-
Training in progress, step 1400
Verified signature9f5181d -
Training in progress, step 1350
Verified signature89a7fa6 -
Training in progress, step 1300
Verified signature0aad9f4 -
Training in progress, step 1250
Verified signaturefc08e1f -
Training in progress, step 1200
Verified signature30ec04f -
Training in progress, step 1150
Verified signature912c6e8 -
Training in progress, step 1100
Verified signature09e2309 -
Training in progress, step 1050
Verified signature7455291 -
Training in progress, step 1000
Verified signature87bef82 -
Training in progress, step 950
Verified signature9b20184 -
Training in progress, step 900
Verified signature71bb448 -
Training in progress, step 850
Verified signature69f2681 -
Training in progress, step 800
Verified signaturee3a2319 -
Training in progress, step 750
Verified signature054fc12 -
Training in progress, step 700
Verified signaturea196ebb -
Training in progress, step 650
Verified signature1f983b6 -
Training in progress, step 600
Verified signature0b4aaa1 -
Training in progress, step 550
Verified signaturef5656c3 -
Training in progress, step 500
Verified signature227137f -
Training in progress, step 450
Verified signaturecb7ed97 -
Training in progress, step 400
Verified signaturefcf66f6 -
Training in progress, step 350
Verified signature479f961 -
Training in progress, step 300
Verified signature089ecad -
Training in progress, step 250
Verified signature87af72a -
Training in progress, step 200
Verified signature69a46b7 -
Training in progress, step 150
Verified signature1de9933 -
Training in progress, step 100
Verified signature72001f0 -
Training in progress, step 50
Verified signaturedfb9522 -
Training in progress, step 450
Verified signaturee3bfdd4 -
Training in progress, step 400
Verified signaturef320e8c -
Training in progress, step 350
Verified signature5545fac -
Training in progress, step 300
Verified signaturef97209d -
Training in progress, step 250
Verified signaturee1df51f