Instructions to use umarigan/blip-image-captioning-base-chestxray-finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use umarigan/blip-image-captioning-base-chestxray-finetuned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="umarigan/blip-image-captioning-base-chestxray-finetuned")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("umarigan/blip-image-captioning-base-chestxray-finetuned") model = AutoModelForImageTextToText.from_pretrained("umarigan/blip-image-captioning-base-chestxray-finetuned") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use umarigan/blip-image-captioning-base-chestxray-finetuned with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "umarigan/blip-image-captioning-base-chestxray-finetuned" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "umarigan/blip-image-captioning-base-chestxray-finetuned", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/umarigan/blip-image-captioning-base-chestxray-finetuned
- SGLang
How to use umarigan/blip-image-captioning-base-chestxray-finetuned 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 "umarigan/blip-image-captioning-base-chestxray-finetuned" \ --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": "umarigan/blip-image-captioning-base-chestxray-finetuned", "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 "umarigan/blip-image-captioning-base-chestxray-finetuned" \ --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": "umarigan/blip-image-captioning-base-chestxray-finetuned", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use umarigan/blip-image-captioning-base-chestxray-finetuned with Docker Model Runner:
docker model run hf.co/umarigan/blip-image-captioning-base-chestxray-finetuned
Model Card for Model ID
Model Details
Model Description
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
- Developed by: Umar Igan
- Model type: VLM
- Language(s) (NLP): English
- License: [More Information Needed]
- Finetuned from model [optional]: Salesforce/blip-image-captioning-base
Model Sources [optional]
- Repository: [More Information Needed]
Uses
This is a fine-tuned VLM on chest xray medicald dataset, the result shouldn't be used as an advice!!
Direct Use
[More Information Needed]
Downstream Use [optional]
[More Information Needed]
Out-of-Scope Use
[More Information Needed]
Bias, Risks, and Limitations
[More Information Needed]
Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
How to Get Started with the Model
Example usage:
from transformers import BlipForConditionalGeneration, AutoProcessor
model = BlipForConditionalGeneration.from_pretrained("umarigan/blip-image-captioning-base-chestxray-finetuned").to(device)
processor = AutoProcessor.from_pretrained("umarigan/blip-image-captioning-base-chestxray-finetuned")
inputs = processor(images=image, return_tensors="pt").to(device)
pixel_values = inputs.pixel_values
generated_ids = model.generate(pixel_values=pixel_values, max_length=50)
generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(generated_caption)
Training Data
https://huggingface.co/datasets/Shrey-1329/cxiu_hf_dataset
Training Hyperparameters
- lr: 5e-5
- Epoch: 10
- Dataset size: 1k
Summary
A simple blip fine-tuned model on medical imaging
Environmental Impact
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
- Hardware Type: GPU
- Hours used: 1
- Cloud Provider: Google
- Compute Region: Frankfurt
- Carbon Emitted:
Compute Infrastructure
Google Colab L4 GPU
Hardware
Google Colab L4 GPU
Model Card Contact
Umar Igan
- Downloads last month
- 36