Instructions to use MahsaShahidi/Persian-Image-Captioning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MahsaShahidi/Persian-Image-Captioning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="MahsaShahidi/Persian-Image-Captioning")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("MahsaShahidi/Persian-Image-Captioning") model = AutoModelForImageTextToText.from_pretrained("MahsaShahidi/Persian-Image-Captioning") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MahsaShahidi/Persian-Image-Captioning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MahsaShahidi/Persian-Image-Captioning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MahsaShahidi/Persian-Image-Captioning", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MahsaShahidi/Persian-Image-Captioning
- SGLang
How to use MahsaShahidi/Persian-Image-Captioning 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 "MahsaShahidi/Persian-Image-Captioning" \ --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": "MahsaShahidi/Persian-Image-Captioning", "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 "MahsaShahidi/Persian-Image-Captioning" \ --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": "MahsaShahidi/Persian-Image-Captioning", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MahsaShahidi/Persian-Image-Captioning with Docker Model Runner:
docker model run hf.co/MahsaShahidi/Persian-Image-Captioning
Commit ·
91f5872
1
Parent(s): 24eb6e4
Update ReadMe.md
Browse files
README.md
CHANGED
|
@@ -14,17 +14,6 @@ This model is a fine-tuned version of [Vision Encoder Decoder](https://huggingfa
|
|
| 14 |
It achieves the following results on the evaluation set:
|
| 15 |
- Loss: 2.4300
|
| 16 |
|
| 17 |
-
## Model description
|
| 18 |
-
|
| 19 |
-
More information needed
|
| 20 |
-
|
| 21 |
-
## Intended uses & limitations
|
| 22 |
-
|
| 23 |
-
More information needed
|
| 24 |
-
|
| 25 |
-
## Training and evaluation data
|
| 26 |
-
|
| 27 |
-
More information needed
|
| 28 |
|
| 29 |
## Training procedure
|
| 30 |
|
|
|
|
| 14 |
It achieves the following results on the evaluation set:
|
| 15 |
- Loss: 2.4300
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
## Training procedure
|
| 19 |
|