Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

ljnlonoljpiljm
/
florence-2-base-ft-objects-mlx

Image-Text-to-Text
Transformers
Safetensors
MLX
florence2
custom_code
Model card Files Files and versions
xet
Community

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
florence-2-base-ft-objects-mlx
548 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 3 commits
ljnlonoljpiljm's picture
ljnlonoljpiljm
Upload folder using huggingface_hub
c633014 verified over 1 year ago
  • .gitattributes
    1.52 kB
    initial commit over 1 year ago
  • README.md
    527 Bytes
    Upload folder using huggingface_hub over 1 year ago
  • added_tokens.json
    22.4 kB
    Upload folder using huggingface_hub over 1 year ago
  • config.json
    6.7 kB
    Upload folder using huggingface_hub over 1 year ago
  • merges.txt
    456 kB
    Upload folder using huggingface_hub over 1 year ago
  • model.safetensors
    542 MB
    xet
    Upload folder using huggingface_hub over 1 year ago
  • model.safetensors.index.json
    60.3 kB
    Upload folder using huggingface_hub over 1 year ago
  • preprocessor_config.json
    603 Bytes
    Upload folder using huggingface_hub over 1 year ago
  • processing_florence2.py
    46.4 kB
    Upload folder using huggingface_hub over 1 year ago
  • processor_config.json
    130 Bytes
    Upload folder using huggingface_hub over 1 year ago
  • special_tokens_map.json
    879 kB
    Upload folder using huggingface_hub over 1 year ago
  • tokenizer.json
    3.75 MB
    Upload folder using huggingface_hub over 1 year ago
  • tokenizer_config.json
    284 kB
    Upload folder using huggingface_hub over 1 year ago
  • vocab.json
    798 kB
    Upload folder using huggingface_hub over 1 year ago