Spaces:
No application file
No application file
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,3 +10,26 @@ pinned: false
|
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 13 |
+
|
| 14 |
+
# Image Captioning (ViT-GPT2) — Hugging Face Space
|
| 15 |
+
|
| 16 |
+
This Space serves an image captioning model using Hugging Face `VisionEncoderDecoderModel` (ViT + GPT-2).
|
| 17 |
+
It runs out-of-the-box with the base model and can optionally load your **fine-tuned** weights.
|
| 18 |
+
|
| 19 |
+
**Live app entrypoint:** `app.py` (Gradio)
|
| 20 |
+
|
| 21 |
+
## Quick Start (on Spaces)
|
| 22 |
+
1. Click **New Space** → **Gradio** → **Blank** → pick a free CPU or T4 small (GPU) runtime.
|
| 23 |
+
2. Upload all files from this repo.
|
| 24 |
+
3. (Optional) If you have fine-tuned weights:
|
| 25 |
+
- Upload the saved folder to the Space (e.g., `outputs/caption_finetune/`)
|
| 26 |
+
- Set a Space secret or environment variable: `MODEL_DIR = outputs/caption_finetune`
|
| 27 |
+
- Alternatively push your weights to the Hub and set `MODEL_DIR = your-username/your-model-repo`
|
| 28 |
+
|
| 29 |
+
If `MODEL_DIR` is not set, the app uses `nlpconnect/vit-gpt2-image-captioning`.
|
| 30 |
+
|
| 31 |
+
## Local Dev
|
| 32 |
+
```bash
|
| 33 |
+
pip install -r requirements.txt
|
| 34 |
+
python app.py
|
| 35 |
+
# then open http://127.0.0.1:7860
|