Instructions to use mdevst/trocr-large-handwritten with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mdevst/trocr-large-handwritten with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("image-to-text", model="mdevst/trocr-large-handwritten")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("mdevst/trocr-large-handwritten") model = AutoModelForMultimodalLM.from_pretrained("mdevst/trocr-large-handwritten", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download config.json from mdevst/trocr-large-handwritten: direct link, hf CLI and curl.
- Browser
- Download file 1.45 kB
-
https://huggingface.co/mdevst/trocr-large-handwritten/resolve/main/config.json
- Command line
-
hf download hf://mdevst/trocr-large-handwritten/config.json
-
curl -L -o config.json https://huggingface.co/mdevst/trocr-large-handwritten/resolve/main/config.json
1.45 kB
| { | |
| "architectures": [ | |
| "VisionEncoderDecoderModel" | |
| ], | |
| "decoder": { | |
| "activation_dropout": 0.0, | |
| "activation_function": "gelu", | |
| "add_cross_attention": true, | |
| "attention_dropout": 0.0, | |
| "classifier_dropout": 0.0, | |
| "cross_attention_hidden_size": 1024, | |
| "d_model": 1024, | |
| "decoder_attention_heads": 16, | |
| "decoder_ffn_dim": 4096, | |
| "decoder_layerdrop": 0.0, | |
| "decoder_layers": 12, | |
| "dropout": 0.1, | |
| "init_std": 0.02, | |
| "is_decoder": true, | |
| "layernorm_embedding": true, | |
| "max_position_embeddings": 512, | |
| "model_type": "trocr", | |
| "scale_embedding": false, | |
| "torch_dtype": "float32", | |
| "use_cache": false, | |
| "use_learned_position_embeddings": true, | |
| "vocab_size": 50265 | |
| }, | |
| "encoder": { | |
| "attention_probs_dropout_prob": 0.0, | |
| "encoder_stride": 16, | |
| "hidden_act": "gelu", | |
| "hidden_dropout_prob": 0.0, | |
| "hidden_size": 1024, | |
| "image_size": 384, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 4096, | |
| "layer_norm_eps": 1e-12, | |
| "model_type": "vit", | |
| "num_attention_heads": 16, | |
| "num_channels": 3, | |
| "num_hidden_layers": 24, | |
| "patch_size": 16, | |
| "pooler_act": "tanh", | |
| "pooler_output_size": 1024, | |
| "qkv_bias": false, | |
| "torch_dtype": "float32" | |
| }, | |
| "is_encoder_decoder": true, | |
| "model_type": "vision-encoder-decoder", | |
| "tie_word_embeddings": false, | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.53.3", | |
| "use_cache": true | |
| } | |