Instructions to use BadreddineHug/donut-base-ocr8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BadreddineHug/donut-base-ocr8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="BadreddineHug/donut-base-ocr8")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("BadreddineHug/donut-base-ocr8") model = AutoModelForImageTextToText.from_pretrained("BadreddineHug/donut-base-ocr8") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use BadreddineHug/donut-base-ocr8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BadreddineHug/donut-base-ocr8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BadreddineHug/donut-base-ocr8", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/BadreddineHug/donut-base-ocr8
- SGLang
How to use BadreddineHug/donut-base-ocr8 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 "BadreddineHug/donut-base-ocr8" \ --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": "BadreddineHug/donut-base-ocr8", "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 "BadreddineHug/donut-base-ocr8" \ --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": "BadreddineHug/donut-base-ocr8", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use BadreddineHug/donut-base-ocr8 with Docker Model Runner:
docker model run hf.co/BadreddineHug/donut-base-ocr8
Commit ·
cc521b2
1
Parent(s): 8499eb3
Training in progress, epoch 3
Browse files
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 809293593
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:26ef50c99857bfaa3be4be9f59dda44f51040c63e8dbea44b87cb80fe4f6a3d4
|
| 3 |
size 809293593
|
runs/Jul06_11-39-17_28e44081c9f5/events.out.tfevents.1688643564.28e44081c9f5.1262.0
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e17451842c1a32cef21b983dd51de9561e3a1af0a10ddeef87267a47a98aa9d8
|
| 3 |
+
size 19175
|