ryanlinjui/menu-zh-TW
Viewer • Updated • 248 • 34
How to use ryanlinjui/donut-base-finetuned-menu with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="ryanlinjui/donut-base-finetuned-menu") # Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("ryanlinjui/donut-base-finetuned-menu")
model = AutoModelForMultimodalLM.from_pretrained("ryanlinjui/donut-base-finetuned-menu")How to use ryanlinjui/donut-base-finetuned-menu with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "ryanlinjui/donut-base-finetuned-menu"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ryanlinjui/donut-base-finetuned-menu",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/ryanlinjui/donut-base-finetuned-menu
How to use ryanlinjui/donut-base-finetuned-menu with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "ryanlinjui/donut-base-finetuned-menu" \
--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": "ryanlinjui/donut-base-finetuned-menu",
"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 "ryanlinjui/donut-base-finetuned-menu" \
--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": "ryanlinjui/donut-base-finetuned-menu",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use ryanlinjui/donut-base-finetuned-menu with Docker Model Runner:
docker model run hf.co/ryanlinjui/donut-base-finetuned-menu
This model is a fine-tuned version of naver-clova-ix/donut-base.
Note: Dataset’s format representation differs from the original. It has been specially processed by this script, which is dedicated to handling Document Parsing Task.
Base model
naver-clova-ix/donut-base