Run this model with HF Jobs
Run Akajackson/donut_rus on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/Akajackson/donut_rus. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Akajackson/donut_rus on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Akajackson/donut_rus. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/Akajackson/donut_rus. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use Akajackson/donut_rus with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Akajackson/donut_rus with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Akajackson/donut_rus")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Akajackson/donut_rus") model = AutoModelForMultimodalLM.from_pretrained("Akajackson/donut_rus", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Akajackson/donut_rus with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Akajackson/donut_rus" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Akajackson/donut_rus", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Akajackson/donut_rus
- SGLang
How to use Akajackson/donut_rus 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 "Akajackson/donut_rus" \ --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": "Akajackson/donut_rus", "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 "Akajackson/donut_rus" \ --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": "Akajackson/donut_rus", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Akajackson/donut_rus with Docker Model Runner:
docker model run hf.co/Akajackson/donut_rus
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("Akajackson/donut_rus")
model = AutoModelForMultimodalLM.from_pretrained("Akajackson/donut_rus", device_map="auto")Описание модели
Модель Donut (end-to-end transformer) для распознавания текстов на русском языке.
https://github.com/clovaai/donut
Для обучения сгенерирован датасет SynthDoG из 100тыс изображений, с текстами, взятыми из произведений русской литературы.
https://huggingface.co/datasets/Akajackson/donut_synthdog_rus
Модель обучена на ноутбуке от уважаемого NielsRogge с заменой оригинального токенайзера на DeepPavlov/xlm-roberta-large-en-ru на площадке Kaggle.
https://github.com/NielsRogge/Transformers-Tutorials/blob/master/Donut/CORD/Fine_tune_Donut_on_a_custom_dataset_(CORD)_with_PyTorch_Lightning.ipynb
Метрика на валидации Normed ED: 0.02239.
Возможности модели
Данная модель является базовой для следующих задач:
- распознавание различных типов документов;
- ответы на вопросы по документу;
- классификация документов.
Для решения Вашей задачи возможно использовать выше упомянутые ноутбуки.
Датасет необходимо разметить в формате, который указан в репозитории Donut.
- Downloads last month
- 123
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Akajackson/donut_rus")