Instructions to use peeper/caption-generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use peeper/caption-generator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="peeper/caption-generator")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("peeper/caption-generator") model = AutoModelForMultimodalLM.from_pretrained("peeper/caption-generator", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use peeper/caption-generator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "peeper/caption-generator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "peeper/caption-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/peeper/caption-generator
- SGLang
How to use peeper/caption-generator 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 "peeper/caption-generator" \ --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": "peeper/caption-generator", "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 "peeper/caption-generator" \ --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": "peeper/caption-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use peeper/caption-generator with Docker Model Runner:
docker model run hf.co/peeper/caption-generator
| { | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 1.8867924528301887, | |
| "global_step": 2000, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.47, | |
| "learning_rate": 4.213836477987422e-05, | |
| "loss": 0.3579, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 0.94, | |
| "learning_rate": 3.4276729559748424e-05, | |
| "loss": 0.3025, | |
| "step": 1000 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "eval_gen_len": 14.745930644019817, | |
| "eval_loss": 0.3904925584793091, | |
| "eval_rouge1": 22.6674, | |
| "eval_rouge2": 5.4037, | |
| "eval_rougeL": 20.2687, | |
| "eval_rougeLsum": 20.297, | |
| "eval_runtime": 247.0796, | |
| "eval_samples_per_second": 5.719, | |
| "eval_steps_per_second": 1.433, | |
| "step": 1060 | |
| }, | |
| { | |
| "epoch": 1.42, | |
| "learning_rate": 2.641509433962264e-05, | |
| "loss": 0.2978, | |
| "step": 1500 | |
| }, | |
| { | |
| "epoch": 1.89, | |
| "learning_rate": 1.8553459119496856e-05, | |
| "loss": 0.2772, | |
| "step": 2000 | |
| } | |
| ], | |
| "max_steps": 3180, | |
| "num_train_epochs": 3, | |
| "total_flos": 1.4560912647225262e+18, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |