Instructions to use Rodr16020/trocr_handwriten_cursive_text_detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Rodr16020/trocr_handwriten_cursive_text_detection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Rodr16020/trocr_handwriten_cursive_text_detection")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Rodr16020/trocr_handwriten_cursive_text_detection") model = AutoModelForMultimodalLM.from_pretrained("Rodr16020/trocr_handwriten_cursive_text_detection") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Rodr16020/trocr_handwriten_cursive_text_detection with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Rodr16020/trocr_handwriten_cursive_text_detection" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rodr16020/trocr_handwriten_cursive_text_detection", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Rodr16020/trocr_handwriten_cursive_text_detection
- SGLang
How to use Rodr16020/trocr_handwriten_cursive_text_detection 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 "Rodr16020/trocr_handwriten_cursive_text_detection" \ --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": "Rodr16020/trocr_handwriten_cursive_text_detection", "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 "Rodr16020/trocr_handwriten_cursive_text_detection" \ --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": "Rodr16020/trocr_handwriten_cursive_text_detection", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Rodr16020/trocr_handwriten_cursive_text_detection with Docker Model Runner:
docker model run hf.co/Rodr16020/trocr_handwriten_cursive_text_detection
Finetuned V2 with more and curated data
Browse files- preprocessor_config.json +0 -14
- tokenizer.json +0 -0
- tokenizer_config.json +0 -1
preprocessor_config.json
CHANGED
|
@@ -1,18 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"_valid_processor_keys": [
|
| 3 |
-
"images",
|
| 4 |
-
"do_resize",
|
| 5 |
-
"size",
|
| 6 |
-
"resample",
|
| 7 |
-
"do_rescale",
|
| 8 |
-
"rescale_factor",
|
| 9 |
-
"do_normalize",
|
| 10 |
-
"image_mean",
|
| 11 |
-
"image_std",
|
| 12 |
-
"return_tensors",
|
| 13 |
-
"data_format",
|
| 14 |
-
"input_data_format"
|
| 15 |
-
],
|
| 16 |
"do_normalize": true,
|
| 17 |
"do_rescale": true,
|
| 18 |
"do_resize": true,
|
|
|
|
| 1 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
"do_normalize": true,
|
| 3 |
"do_rescale": true,
|
| 4 |
"do_resize": true,
|
tokenizer.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
CHANGED
|
@@ -45,7 +45,6 @@
|
|
| 45 |
"bos_token": "<s>",
|
| 46 |
"clean_up_tokenization_spaces": true,
|
| 47 |
"cls_token": "<s>",
|
| 48 |
-
"device_map": "cuda:1",
|
| 49 |
"eos_token": "</s>",
|
| 50 |
"errors": "replace",
|
| 51 |
"mask_token": "<mask>",
|
|
|
|
| 45 |
"bos_token": "<s>",
|
| 46 |
"clean_up_tokenization_spaces": true,
|
| 47 |
"cls_token": "<s>",
|
|
|
|
| 48 |
"eos_token": "</s>",
|
| 49 |
"errors": "replace",
|
| 50 |
"mask_token": "<mask>",
|