Instructions to use abhipsapanda/imagecap with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use abhipsapanda/imagecap with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="abhipsapanda/imagecap")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("abhipsapanda/imagecap") model = AutoModelForImageTextToText.from_pretrained("abhipsapanda/imagecap") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use abhipsapanda/imagecap with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "abhipsapanda/imagecap" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "abhipsapanda/imagecap", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/abhipsapanda/imagecap
- SGLang
How to use abhipsapanda/imagecap 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 "abhipsapanda/imagecap" \ --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": "abhipsapanda/imagecap", "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 "abhipsapanda/imagecap" \ --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": "abhipsapanda/imagecap", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use abhipsapanda/imagecap with Docker Model Runner:
docker model run hf.co/abhipsapanda/imagecap
| { | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 2.024715768660405, | |
| "global_step": 4096, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.51, | |
| "learning_rate": 5e-05, | |
| "loss": 3.4077, | |
| "step": 1024 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "eval_loss": 2.4766957759857178, | |
| "eval_rouge2_fmeasure": 0.0513, | |
| "eval_rouge2_precision": 0.0296, | |
| "eval_rouge2_recall": 0.2472, | |
| "eval_runtime": 9350.9062, | |
| "eval_samples_per_second": 0.865, | |
| "eval_steps_per_second": 0.054, | |
| "step": 2023 | |
| }, | |
| { | |
| "epoch": 1.01, | |
| "learning_rate": 3.985133795837463e-05, | |
| "loss": 2.6431, | |
| "step": 2048 | |
| }, | |
| { | |
| "epoch": 1.52, | |
| "learning_rate": 2.9702675916749255e-05, | |
| "loss": 2.3161, | |
| "step": 3072 | |
| }, | |
| { | |
| "epoch": 2.0, | |
| "eval_loss": 2.278710126876831, | |
| "eval_rouge2_fmeasure": 0.0574, | |
| "eval_rouge2_precision": 0.0327, | |
| "eval_rouge2_recall": 0.2966, | |
| "eval_runtime": 9356.4308, | |
| "eval_samples_per_second": 0.865, | |
| "eval_steps_per_second": 0.054, | |
| "step": 4046 | |
| }, | |
| { | |
| "epoch": 2.02, | |
| "learning_rate": 1.9554013875123885e-05, | |
| "loss": 2.2142, | |
| "step": 4096 | |
| } | |
| ], | |
| "max_steps": 6069, | |
| "num_train_epochs": 3, | |
| "total_flos": 1.1825437857319748e+19, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |