Instructions to use ayoubkirouane/moondream2-image-captcha with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ayoubkirouane/moondream2-image-captcha with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ayoubkirouane/moondream2-image-captcha", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ayoubkirouane/moondream2-image-captcha", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ayoubkirouane/moondream2-image-captcha with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ayoubkirouane/moondream2-image-captcha" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ayoubkirouane/moondream2-image-captcha", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ayoubkirouane/moondream2-image-captcha
- SGLang
How to use ayoubkirouane/moondream2-image-captcha 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 "ayoubkirouane/moondream2-image-captcha" \ --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": "ayoubkirouane/moondream2-image-captcha", "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 "ayoubkirouane/moondream2-image-captcha" \ --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": "ayoubkirouane/moondream2-image-captcha", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ayoubkirouane/moondream2-image-captcha with Docker Model Runner:
docker model run hf.co/ayoubkirouane/moondream2-image-captcha
Upload folder using huggingface_hub
Browse files- config.json +4 -3
- generation_config.json +1 -1
config.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"Moondream"
|
| 4 |
],
|
| 5 |
"auto_map": {
|
| 6 |
-
"AutoConfig": "configuration_moondream.MoondreamConfig",
|
| 7 |
-
"AutoModelForCausalLM": "moondream.Moondream"
|
| 8 |
},
|
| 9 |
"model_type": "moondream1",
|
| 10 |
"text_config": {
|
| 11 |
"model_type": "phi"
|
| 12 |
},
|
| 13 |
"torch_dtype": "float16",
|
| 14 |
-
"transformers_version": "4.
|
| 15 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "vikhyatk/moondream2",
|
| 3 |
"architectures": [
|
| 4 |
"Moondream"
|
| 5 |
],
|
| 6 |
"auto_map": {
|
| 7 |
+
"AutoConfig": "vikhyatk/moondream2--configuration_moondream.MoondreamConfig",
|
| 8 |
+
"AutoModelForCausalLM": "vikhyatk/moondream2--moondream.Moondream"
|
| 9 |
},
|
| 10 |
"model_type": "moondream1",
|
| 11 |
"text_config": {
|
| 12 |
"model_type": "phi"
|
| 13 |
},
|
| 14 |
"torch_dtype": "float16",
|
| 15 |
+
"transformers_version": "4.41.0"
|
| 16 |
}
|
generation_config.json
CHANGED
|
@@ -2,5 +2,5 @@
|
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
-
"transformers_version": "4.
|
| 6 |
}
|
|
|
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
+
"transformers_version": "4.41.0"
|
| 6 |
}
|