Instructions to use WafaaFraih/vit-gpt2-medical-optimized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use WafaaFraih/vit-gpt2-medical-optimized with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="WafaaFraih/vit-gpt2-medical-optimized")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("WafaaFraih/vit-gpt2-medical-optimized") model = AutoModelForImageTextToText.from_pretrained("WafaaFraih/vit-gpt2-medical-optimized") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use WafaaFraih/vit-gpt2-medical-optimized with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "WafaaFraih/vit-gpt2-medical-optimized" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WafaaFraih/vit-gpt2-medical-optimized", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/WafaaFraih/vit-gpt2-medical-optimized
- SGLang
How to use WafaaFraih/vit-gpt2-medical-optimized 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/vit-gpt2-medical-optimized" \ --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/vit-gpt2-medical-optimized", "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/vit-gpt2-medical-optimized" \ --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/vit-gpt2-medical-optimized", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use WafaaFraih/vit-gpt2-medical-optimized with Docker Model Runner:
docker model run hf.co/WafaaFraih/vit-gpt2-medical-optimized
vit-gpt2-medical-optimized
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.0098
- Bleu: 0.9833
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: 2
- eval_batch_size: 2
- seed: 42
- gradient_accumulation_steps: 8
- total_train_batch_size: 16
- optimizer: Use OptimizerNames.ADAMW_8BIT with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 100
- num_epochs: 3
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Validation Loss | Bleu |
|---|---|---|---|---|
| 5.4924 | 0.9412 | 250 | 5.3911 | 0.0 |
| 5.1009 | 1.8809 | 500 | 5.0913 | 3.9891 |
| 4.7911 | 2.8207 | 750 | 5.0098 | 0.9833 |
Framework versions
- Transformers 4.56.0
- Pytorch 2.8.0+cu126
- Datasets 4.0.0
- Tokenizers 0.22.0
- Downloads last month
- 1
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Model tree for WafaaFraih/vit-gpt2-medical-optimized
Base model
nlpconnect/vit-gpt2-image-captioning