Image-Text-to-Text
Transformers
TensorBoard
Safetensors
vision-encoder-decoder
Generated from Trainer
Instructions to use Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02") model = AutoModelForMultimodalLM.from_pretrained("Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02
- SGLang
How to use Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02 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 "Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02" \ --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": "Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02", "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 "Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02" \ --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": "Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02 with Docker Model Runner:
docker model run hf.co/Image-Captioning-ML/Vit-GPT2-COCO2017Flickr-02
Training in progress, step 500
Browse files
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "
|
| 3 |
"architectures": [
|
| 4 |
"VisionEncoderDecoderModel"
|
| 5 |
],
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "nlpconnect/vit-gpt2-image-captioning",
|
| 3 |
"architectures": [
|
| 4 |
"VisionEncoderDecoderModel"
|
| 5 |
],
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 956835520
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:594424b333f1058d33644570898ff6ccff635221bf92d17a4e12c6996c16d44f
|
| 3 |
size 956835520
|
runs/May19_22-38-40_5165d5873620/events.out.tfevents.1716158321.5165d5873620.34.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:47521995217c9bc29b1785e3bc7286547e8e3a0cadd415ee3b573748826ce840
|
| 3 |
+
size 9784
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 5112
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:72530bd72a68a056d7027f32838cd1f10bf766123a90c784f019ceb39ccc4d2d
|
| 3 |
size 5112
|