Instructions to use eduardo-bolognini/imagecaptioning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use eduardo-bolognini/imagecaptioning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="eduardo-bolognini/imagecaptioning")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("eduardo-bolognini/imagecaptioning") model = AutoModelForImageTextToText.from_pretrained("eduardo-bolognini/imagecaptioning") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use eduardo-bolognini/imagecaptioning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "eduardo-bolognini/imagecaptioning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "eduardo-bolognini/imagecaptioning", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/eduardo-bolognini/imagecaptioning
- SGLang
How to use eduardo-bolognini/imagecaptioning 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 "eduardo-bolognini/imagecaptioning" \ --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": "eduardo-bolognini/imagecaptioning", "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 "eduardo-bolognini/imagecaptioning" \ --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": "eduardo-bolognini/imagecaptioning", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use eduardo-bolognini/imagecaptioning with Docker Model Runner:
docker model run hf.co/eduardo-bolognini/imagecaptioning
Upload BlipForConditionalGeneration
Browse files- config.json +21 -3
- generation_config.json +1 -1
- model.safetensors +1 -1
config.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "Salesforce/blip-image-captioning-large",
|
| 3 |
"architectures": [
|
| 4 |
"BlipForConditionalGeneration"
|
| 5 |
],
|
|
@@ -12,25 +11,44 @@
|
|
| 12 |
"projection_dim": 512,
|
| 13 |
"text_config": {
|
| 14 |
"_attn_implementation_autoset": true,
|
|
|
|
| 15 |
"encoder_hidden_size": 1024,
|
|
|
|
|
|
|
|
|
|
| 16 |
"initializer_factor": 1.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
"model_type": "blip_text_model",
|
| 18 |
"num_attention_heads": 12,
|
| 19 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
},
|
| 21 |
"torch_dtype": "float32",
|
| 22 |
-
"transformers_version": "4.
|
| 23 |
"vision_config": {
|
| 24 |
"_attn_implementation_autoset": true,
|
|
|
|
| 25 |
"dropout": 0.0,
|
|
|
|
| 26 |
"hidden_size": 1024,
|
|
|
|
| 27 |
"initializer_factor": 1.0,
|
| 28 |
"initializer_range": 0.02,
|
| 29 |
"intermediate_size": 4096,
|
|
|
|
| 30 |
"model_type": "blip_vision_model",
|
| 31 |
"num_attention_heads": 16,
|
| 32 |
"num_channels": 3,
|
| 33 |
"num_hidden_layers": 24,
|
|
|
|
|
|
|
| 34 |
"torch_dtype": "float32"
|
| 35 |
}
|
| 36 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"BlipForConditionalGeneration"
|
| 4 |
],
|
|
|
|
| 11 |
"projection_dim": 512,
|
| 12 |
"text_config": {
|
| 13 |
"_attn_implementation_autoset": true,
|
| 14 |
+
"attention_probs_dropout_prob": 0.0,
|
| 15 |
"encoder_hidden_size": 1024,
|
| 16 |
+
"hidden_act": "gelu",
|
| 17 |
+
"hidden_dropout_prob": 0.0,
|
| 18 |
+
"hidden_size": 768,
|
| 19 |
"initializer_factor": 1.0,
|
| 20 |
+
"initializer_range": 0.02,
|
| 21 |
+
"intermediate_size": 3072,
|
| 22 |
+
"label_smoothing": 0.0,
|
| 23 |
+
"layer_norm_eps": 1e-12,
|
| 24 |
+
"max_position_embeddings": 512,
|
| 25 |
"model_type": "blip_text_model",
|
| 26 |
"num_attention_heads": 12,
|
| 27 |
+
"num_hidden_layers": 12,
|
| 28 |
+
"projection_dim": 768,
|
| 29 |
+
"torch_dtype": "float32",
|
| 30 |
+
"use_cache": true,
|
| 31 |
+
"vocab_size": 30524
|
| 32 |
},
|
| 33 |
"torch_dtype": "float32",
|
| 34 |
+
"transformers_version": "4.51.3",
|
| 35 |
"vision_config": {
|
| 36 |
"_attn_implementation_autoset": true,
|
| 37 |
+
"attention_dropout": 0.0,
|
| 38 |
"dropout": 0.0,
|
| 39 |
+
"hidden_act": "gelu",
|
| 40 |
"hidden_size": 1024,
|
| 41 |
+
"image_size": 384,
|
| 42 |
"initializer_factor": 1.0,
|
| 43 |
"initializer_range": 0.02,
|
| 44 |
"intermediate_size": 4096,
|
| 45 |
+
"layer_norm_eps": 1e-05,
|
| 46 |
"model_type": "blip_vision_model",
|
| 47 |
"num_attention_heads": 16,
|
| 48 |
"num_channels": 3,
|
| 49 |
"num_hidden_layers": 24,
|
| 50 |
+
"patch_size": 16,
|
| 51 |
+
"projection_dim": 512,
|
| 52 |
"torch_dtype": "float32"
|
| 53 |
}
|
| 54 |
}
|
generation_config.json
CHANGED
|
@@ -3,5 +3,5 @@
|
|
| 3 |
"bos_token_id": 30522,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
"pad_token_id": 0,
|
| 6 |
-
"transformers_version": "4.
|
| 7 |
}
|
|
|
|
| 3 |
"bos_token_id": 30522,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
"pad_token_id": 0,
|
| 6 |
+
"transformers_version": "4.51.3"
|
| 7 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1879010480
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0de3db3affcab08f3c26f4a163b03709c52a1f16922dc88172cff015ed4c683e
|
| 3 |
size 1879010480
|