Instructions to use ljnlonoljpiljm/florence-2-base-ft-objects-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ljnlonoljpiljm/florence-2-base-ft-objects-mlx with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ljnlonoljpiljm/florence-2-base-ft-objects-mlx", trust_remote_code=True)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("ljnlonoljpiljm/florence-2-base-ft-objects-mlx", trust_remote_code=True) model = AutoModelForImageTextToText.from_pretrained("ljnlonoljpiljm/florence-2-base-ft-objects-mlx", trust_remote_code=True) - MLX
How to use ljnlonoljpiljm/florence-2-base-ft-objects-mlx with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("ljnlonoljpiljm/florence-2-base-ft-objects-mlx") config = load_config("ljnlonoljpiljm/florence-2-base-ft-objects-mlx") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- vLLM
How to use ljnlonoljpiljm/florence-2-base-ft-objects-mlx with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ljnlonoljpiljm/florence-2-base-ft-objects-mlx" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ljnlonoljpiljm/florence-2-base-ft-objects-mlx", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ljnlonoljpiljm/florence-2-base-ft-objects-mlx
- SGLang
How to use ljnlonoljpiljm/florence-2-base-ft-objects-mlx 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 "ljnlonoljpiljm/florence-2-base-ft-objects-mlx" \ --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": "ljnlonoljpiljm/florence-2-base-ft-objects-mlx", "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 "ljnlonoljpiljm/florence-2-base-ft-objects-mlx" \ --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": "ljnlonoljpiljm/florence-2-base-ft-objects-mlx", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ljnlonoljpiljm/florence-2-base-ft-objects-mlx with Docker Model Runner:
docker model run hf.co/ljnlonoljpiljm/florence-2-base-ft-objects-mlx
ljnlonoljpiljm/florence-2-base-ft-objects-mlx
This model was converted to MLX format from ljnlonoljpiljm/florence-2-base-ft-objects using mlx-vlm version 0.1.4.
Refer to the original model card for more details on the model.
Use with mlx
pip install -U mlx-vlm
python -m mlx_vlm.generate --model ljnlonoljpiljm/florence-2-base-ft-objects-mlx --max-tokens 100 --temp 0.0
- Downloads last month
- 15
Model size
0.3B params
Tensor type
F16
·
Hardware compatibility
Log In to add your hardware
Quantized
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support