Instructions to use Mharbulous/moondream2-syncopaid with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Mharbulous/moondream2-syncopaid with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Mharbulous/moondream2-syncopaid:F16 # Run inference directly in the terminal: llama cli -hf Mharbulous/moondream2-syncopaid:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Mharbulous/moondream2-syncopaid:F16 # Run inference directly in the terminal: llama cli -hf Mharbulous/moondream2-syncopaid:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Mharbulous/moondream2-syncopaid:F16 # Run inference directly in the terminal: ./llama-cli -hf Mharbulous/moondream2-syncopaid:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Mharbulous/moondream2-syncopaid:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Mharbulous/moondream2-syncopaid:F16
Use Docker
docker model run hf.co/Mharbulous/moondream2-syncopaid:F16
- LM Studio
- Jan
- vLLM
How to use Mharbulous/moondream2-syncopaid with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Mharbulous/moondream2-syncopaid" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mharbulous/moondream2-syncopaid", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Mharbulous/moondream2-syncopaid:F16
- Ollama
How to use Mharbulous/moondream2-syncopaid with Ollama:
ollama run hf.co/Mharbulous/moondream2-syncopaid:F16
- Unsloth Studio
How to use Mharbulous/moondream2-syncopaid with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Mharbulous/moondream2-syncopaid to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Mharbulous/moondream2-syncopaid to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Mharbulous/moondream2-syncopaid to start chatting
- Atomic Chat new
- Docker Model Runner
How to use Mharbulous/moondream2-syncopaid with Docker Model Runner:
docker model run hf.co/Mharbulous/moondream2-syncopaid:F16
- Lemonade
How to use Mharbulous/moondream2-syncopaid with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Mharbulous/moondream2-syncopaid:F16
Run and chat with the model
lemonade run user.moondream2-syncopaid-F16
List all available models
lemonade list
| # Ethically sourced from https://github.com/xjdr-alt/entropix | |
| import torch | |
| def precompute_freqs_cis( | |
| dim: int, | |
| end: int, | |
| theta: float = 10000.0, | |
| use_scaled: bool = False, | |
| dtype: torch.dtype = torch.float32, | |
| ) -> torch.Tensor: | |
| freqs = 1.0 / (theta ** (torch.arange(0, dim, 2, dtype=dtype)[: (dim // 2)] / dim)) | |
| t = torch.arange(end, dtype=dtype).unsqueeze(1) | |
| freqs = t * freqs.unsqueeze(0) | |
| freqs = torch.exp(1j * freqs) | |
| return torch.stack([freqs.real, freqs.imag], dim=-1) | |
| def apply_rotary_emb( | |
| x: torch.Tensor, | |
| freqs_cis: torch.Tensor, | |
| position_ids: torch.Tensor, | |
| num_heads: int, | |
| rot_dim: int = 32, | |
| interleave: bool = False, | |
| ) -> torch.Tensor: | |
| assert rot_dim == freqs_cis.shape[-2] * 2 | |
| assert num_heads == x.shape[1] | |
| x_rot, x_pass = x[..., :rot_dim], x[..., rot_dim:] | |
| if interleave: | |
| xq_r = x_rot.float().reshape(*x_rot.shape[:-1], -1, 2)[..., 0] | |
| xq_i = x_rot.float().reshape(*x_rot.shape[:-1], -1, 2)[..., 1] | |
| else: | |
| d_q = x_rot.shape[-1] // 2 | |
| xq_r, xq_i = x_rot[..., :d_q], x_rot[..., d_q:] | |
| freqs_cos = freqs_cis[..., 0][position_ids, :].unsqueeze(0).unsqueeze(0) | |
| freqs_sin = freqs_cis[..., 1][position_ids, :].unsqueeze(0).unsqueeze(0) | |
| # Complex multiplication: (a + bi) * (c + di) = (ac - bd) + (ad + bc)i | |
| xq_out_r = xq_r * freqs_cos - xq_i * freqs_sin | |
| xq_out_i = xq_r * freqs_sin + xq_i * freqs_cos | |
| xq_out = torch.stack((xq_out_r, xq_out_i), dim=-1).flatten(-2) | |
| return torch.cat([xq_out.to(x.dtype), x_pass], dim=-1) | |