hf-tuner/rvl-cdip-document-classification
Viewer • Updated • 8.99k • 99
How to use hf-tuner/donut-classification-turbo with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="hf-tuner/donut-classification-turbo") # Load model directly
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("hf-tuner/donut-classification-turbo")
model = AutoModel.from_pretrained("hf-tuner/donut-classification-turbo")How to use hf-tuner/donut-classification-turbo with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "hf-tuner/donut-classification-turbo"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "hf-tuner/donut-classification-turbo",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/hf-tuner/donut-classification-turbo
How to use hf-tuner/donut-classification-turbo with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "hf-tuner/donut-classification-turbo" \
--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": "hf-tuner/donut-classification-turbo",
"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 "hf-tuner/donut-classification-turbo" \
--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": "hf-tuner/donut-classification-turbo",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use hf-tuner/donut-classification-turbo with Docker Model Runner:
docker model run hf.co/hf-tuner/donut-classification-turbo
This model is a fine-tuned version of donut-base-finetuned-rvl-cdip on rvl-cdip-document-classification dataset. It achieves the following results on the evaluation set:
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.1319 | 0.5 | 2000 | 0.1200 |
| 0.1365 | 1.0 | 4000 | 0.0845 |
| 0.1203 | 1.5 | 6000 | 0.0751 |
| 0.1128 | 2.0 | 8000 | 0.0677 |
| 0.0734 | 2.5 | 10000 | 0.0541 |
| 0.0707 | 3.0 | 12000 | 0.0499 |