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")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("Akajackson/donut_rus") model = AutoModelForImageTextToText.from_pretrained("Akajackson/donut_rus") - 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
Commit ·
afb2e77
1
Parent(s): 7546711
Training in progress, epoch 0
Browse files- added_tokens.json +2 -1
- tokenizer.json +9 -0
- tokenizer_config.json +1 -1
added_tokens.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"<s_500k>": 35054
|
|
|
|
| 3 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"<s_500k>": 35054,
|
| 3 |
+
"<s_donut_rus>": 35055
|
| 4 |
}
|
tokenizer.json
CHANGED
|
@@ -56,6 +56,15 @@
|
|
| 56 |
"rstrip": false,
|
| 57 |
"normalized": true,
|
| 58 |
"special": false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
}
|
| 60 |
],
|
| 61 |
"normalizer": {
|
|
|
|
| 56 |
"rstrip": false,
|
| 57 |
"normalized": true,
|
| 58 |
"special": false
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"id": 35055,
|
| 62 |
+
"content": "<s_donut_rus>",
|
| 63 |
+
"single_word": false,
|
| 64 |
+
"lstrip": false,
|
| 65 |
+
"rstrip": false,
|
| 66 |
+
"normalized": true,
|
| 67 |
+
"special": false
|
| 68 |
}
|
| 69 |
],
|
| 70 |
"normalizer": {
|
tokenizer_config.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"bos_token": "<s>",
|
|
|
|
| 3 |
"cls_token": "<s>",
|
| 4 |
"eos_token": "</s>",
|
| 5 |
"mask_token": {
|
|
@@ -15,7 +16,6 @@
|
|
| 15 |
"processor_class": "DonutProcessor",
|
| 16 |
"sep_token": "</s>",
|
| 17 |
"sp_model_kwargs": {},
|
| 18 |
-
"special_tokens_map_file": "/root/.cache/huggingface/transformers/6ea33bfad55f516eeb1e52bb6e3f5c198c976c6ebfaa7e1fb9f56b33b2ddc8a9.f6ac38e94db1fb749ad0f52af2f7cd5b7863b9b30f1aa680a1b0d22ec09b717d",
|
| 19 |
"tokenizer_class": "XLMRobertaTokenizer",
|
| 20 |
"unk_token": "<unk>"
|
| 21 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"bos_token": "<s>",
|
| 3 |
+
"clean_up_tokenization_spaces": true,
|
| 4 |
"cls_token": "<s>",
|
| 5 |
"eos_token": "</s>",
|
| 6 |
"mask_token": {
|
|
|
|
| 16 |
"processor_class": "DonutProcessor",
|
| 17 |
"sep_token": "</s>",
|
| 18 |
"sp_model_kwargs": {},
|
|
|
|
| 19 |
"tokenizer_class": "XLMRobertaTokenizer",
|
| 20 |
"unk_token": "<unk>"
|
| 21 |
}
|