dathuynh1108/captcha-to-text
Viewer • Updated • 9k • 1.08k
How to use dathuynh1108/ocr-captcha-v3-finetuned with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="dathuynh1108/ocr-captcha-v3-finetuned") # Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("dathuynh1108/ocr-captcha-v3-finetuned")
model = AutoModelForMultimodalLM.from_pretrained("dathuynh1108/ocr-captcha-v3-finetuned")How to use dathuynh1108/ocr-captcha-v3-finetuned with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "dathuynh1108/ocr-captcha-v3-finetuned"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "dathuynh1108/ocr-captcha-v3-finetuned",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/dathuynh1108/ocr-captcha-v3-finetuned
How to use dathuynh1108/ocr-captcha-v3-finetuned with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "dathuynh1108/ocr-captcha-v3-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": "dathuynh1108/ocr-captcha-v3-finetuned",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "dathuynh1108/ocr-captcha-v3-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": "dathuynh1108/ocr-captcha-v3-finetuned",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use dathuynh1108/ocr-captcha-v3-finetuned with Docker Model Runner:
docker model run hf.co/dathuynh1108/ocr-captcha-v3-finetuned
This model is a fine-tuned version of anuashok/ocr-captcha-v3 on the dathuynh1108/captcha-to-text dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Cer |
|---|---|---|---|---|
| 0.0563 | 1.0 | 2532 | 0.0877 | 0.0074 |
| 0.0144 | 2.0 | 5064 | 0.1097 | 0.008 |
| 0.0175 | 3.0 | 7596 | 0.1212 | 0.0068 |
| 0.0210 | 4.0 | 10128 | 0.1025 | 0.0071 |
| 0.0007 | 5.0 | 12660 | 0.1109 | 0.0068 |
| 0.0003 | 6.0 | 15192 | 0.1112 | 0.0057 |
| 0.0023 | 7.0 | 17724 | 0.1164 | 0.0060 |
| 0.0001 | 8.0 | 20256 | 0.1117 | 0.0056 |
| 0.0000 | 9.0 | 22788 | 0.1153 | 0.0054 |
| 0.0000 | 10.0 | 25320 | 0.1145 | 0.0056 |