Image-Text-to-Text
Transformers
TensorBoard
Safetensors
vision-encoder-decoder
Generated from Trainer
Instructions to use WafaaFraih/medical-caption-model-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use WafaaFraih/medical-caption-model-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="WafaaFraih/medical-caption-model-v1")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("WafaaFraih/medical-caption-model-v1") model = AutoModelForMultimodalLM.from_pretrained("WafaaFraih/medical-caption-model-v1") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use WafaaFraih/medical-caption-model-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "WafaaFraih/medical-caption-model-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WafaaFraih/medical-caption-model-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/WafaaFraih/medical-caption-model-v1
- SGLang
How to use WafaaFraih/medical-caption-model-v1 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 "WafaaFraih/medical-caption-model-v1" \ --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": "WafaaFraih/medical-caption-model-v1", "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 "WafaaFraih/medical-caption-model-v1" \ --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": "WafaaFraih/medical-caption-model-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use WafaaFraih/medical-caption-model-v1 with Docker Model Runner:
docker model run hf.co/WafaaFraih/medical-caption-model-v1
medical-caption-model-v1
This model is a fine-tuned version of nlpconnect/vit-gpt2-image-captioning on an unknown dataset. It achieves the following results on the evaluation set:
- Loss: 5.0189
- Bleu: 0.0332
- Meteor: 5.8196
- Rougel: 10.2378
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 4
- eval_batch_size: 4
- seed: 42
- gradient_accumulation_steps: 8
- total_train_batch_size: 32
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- num_epochs: 10
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Validation Loss | Bleu | Meteor | Rougel |
|---|---|---|---|---|---|---|
| 5.1913 | 2.0 | 200 | 5.2321 | 0.0396 | 7.0115 | 10.6658 |
| 4.6615 | 4.0 | 400 | 4.9947 | 0.0495 | 6.1088 | 10.9570 |
| 4.3567 | 6.0 | 600 | 4.9261 | 0.0384 | 5.7674 | 11.0691 |
| 4.0884 | 8.0 | 800 | 4.9632 | 0.0344 | 5.9190 | 10.6889 |
| 3.9311 | 10.0 | 1000 | 5.0189 | 0.0332 | 5.8196 | 10.2378 |
Framework versions
- Transformers 4.56.1
- Pytorch 2.8.0+cu126
- Datasets 4.0.0
- Tokenizers 0.22.0
- Downloads last month
- -
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Model tree for WafaaFraih/medical-caption-model-v1
Base model
nlpconnect/vit-gpt2-image-captioning