Instructions to use Siddharth63/LFM2.5-forestWHY with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Siddharth63/LFM2.5-forestWHY with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Siddharth63/LFM2.5-forestWHY") 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)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("Siddharth63/LFM2.5-forestWHY") model = AutoModelForImageTextToText.from_pretrained("Siddharth63/LFM2.5-forestWHY") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Siddharth63/LFM2.5-forestWHY with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Siddharth63/LFM2.5-forestWHY" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Siddharth63/LFM2.5-forestWHY", "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/Siddharth63/LFM2.5-forestWHY
- SGLang
How to use Siddharth63/LFM2.5-forestWHY 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 "Siddharth63/LFM2.5-forestWHY" \ --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": "Siddharth63/LFM2.5-forestWHY", "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 "Siddharth63/LFM2.5-forestWHY" \ --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": "Siddharth63/LFM2.5-forestWHY", "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 Siddharth63/LFM2.5-forestWHY with Docker Model Runner:
docker model run hf.co/Siddharth63/LFM2.5-forestWHY
Upload Lfm2VlForConditionalGeneration
Browse files- config.json +1 -1
- generation_config.json +1 -1
- model.safetensors +1 -1
config.json
CHANGED
|
@@ -80,7 +80,7 @@
|
|
| 80 |
},
|
| 81 |
"tie_word_embeddings": true,
|
| 82 |
"tile_size": 512,
|
| 83 |
-
"transformers_version": "5.
|
| 84 |
"use_image_special_tokens": true,
|
| 85 |
"use_thumbnail": true,
|
| 86 |
"vision_config": {
|
|
|
|
| 80 |
},
|
| 81 |
"tie_word_embeddings": true,
|
| 82 |
"tile_size": 512,
|
| 83 |
+
"transformers_version": "5.2.0",
|
| 84 |
"use_image_special_tokens": true,
|
| 85 |
"use_thumbnail": true,
|
| 86 |
"vision_config": {
|
generation_config.json
CHANGED
|
@@ -3,5 +3,5 @@
|
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 7,
|
| 5 |
"pad_token_id": 0,
|
| 6 |
-
"transformers_version": "5.
|
| 7 |
}
|
|
|
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 7,
|
| 5 |
"pad_token_id": 0,
|
| 6 |
+
"transformers_version": "5.2.0"
|
| 7 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3193333624
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e928baf03dc096811774b72130e07326e009e651d3af8a6ff5ff3b77ba621ef2
|
| 3 |
size 3193333624
|