Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

wraps
/
moondream-caption

Image-Text-to-Text
Transformers
Safetensors
moondream1
text-generation
custom_code
Model card Files Files and versions
xet
Community

Instructions to use wraps/moondream-caption with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use wraps/moondream-caption with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("image-text-to-text", model="wraps/moondream-caption", trust_remote_code=True)
    # Load model directly
    from transformers import AutoModelForCausalLM
    model = AutoModelForCausalLM.from_pretrained("wraps/moondream-caption", trust_remote_code=True, dtype="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use wraps/moondream-caption with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "wraps/moondream-caption"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "wraps/moondream-caption",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
    Use Docker
    docker model run hf.co/wraps/moondream-caption
  • SGLang

    How to use wraps/moondream-caption 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 "wraps/moondream-caption" \
        --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": "wraps/moondream-caption",
    		"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 "wraps/moondream-caption" \
            --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": "wraps/moondream-caption",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use wraps/moondream-caption with Docker Model Runner:

    docker model run hf.co/wraps/moondream-caption
moondream-caption
3.74 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 9 commits
wraps's picture
wraps
Update config.json
9bbbd86 verified over 1 year ago
  • .gitattributes
    1.52 kB
    initial commit over 1 year ago
  • README.md
    2.35 kB
    Update README.md over 1 year ago
  • added_tokens.json
    1.08 kB
    Update v1 over 1 year ago
  • config.json
    415 Bytes
    Update config.json over 1 year ago
  • configuration_moondream.py
    3.34 kB
    Update v1 over 1 year ago
  • fourier_features.py
    558 Bytes
    Update v1 over 1 year ago
  • generation_config.json
    111 Bytes
    Update v1 over 1 year ago
  • merges.txt
    456 kB
    Update v1 over 1 year ago
  • model.safetensors
    3.74 GB
    xet
    Update v1 over 1 year ago
  • modeling_phi.py
    63.1 kB
    Update v1 over 1 year ago
  • moondream.py
    7.2 kB
    Update v1 over 1 year ago
  • region_model.py
    1.33 kB
    Update v1 over 1 year ago
  • special_tokens_map.json
    441 Bytes
    Update v1 over 1 year ago
  • tokenizer.json
    2.11 MB
    Update v1 over 1 year ago
  • tokenizer_config.json
    7.37 kB
    Update v1 over 1 year ago
  • vision_encoder.py
    10.2 kB
    Update v1 over 1 year ago
  • vocab.json
    798 kB
    Update v1 over 1 year ago