Instructions to use rohan-2810/image_captioning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rohan-2810/image_captioning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="rohan-2810/image_captioning")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("rohan-2810/image_captioning") model = AutoModelForImageTextToText.from_pretrained("rohan-2810/image_captioning") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rohan-2810/image_captioning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rohan-2810/image_captioning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rohan-2810/image_captioning", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/rohan-2810/image_captioning
- SGLang
How to use rohan-2810/image_captioning 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 "rohan-2810/image_captioning" \ --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": "rohan-2810/image_captioning", "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 "rohan-2810/image_captioning" \ --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": "rohan-2810/image_captioning", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use rohan-2810/image_captioning with Docker Model Runner:
docker model run hf.co/rohan-2810/image_captioning
Upload 3 files
Browse files- .gitattributes +3 -0
- model.safetensors +3 -0
- pytorch_model.bin +3 -0
- tf_model.h5 +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
pytorch_model.bin filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
tf_model.h5 filter=lfs diff=lfs merge=lfs -text
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ebc867586b8318647dd7b75ef8e52f93f89b98ac7dcbd04d10219d33b9a68c6f
|
| 3 |
+
size 1879014680
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:66c8aec8d91b5e74b86bde343ed95fb53e9ccf9ffc77c5093890df662d234e04
|
| 3 |
+
size 1879143921
|
tf_model.h5
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9fb4b74fce7b1f965cbc7bc9b58db27cfaaebfa0d86e27d49fec877288a11852
|
| 3 |
+
size 1879709248
|