Instructions to use FixFips/khatt-trocr-finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FixFips/khatt-trocr-finetuned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="FixFips/khatt-trocr-finetuned")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("FixFips/khatt-trocr-finetuned") model = AutoModelForMultimodalLM.from_pretrained("FixFips/khatt-trocr-finetuned", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FixFips/khatt-trocr-finetuned with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FixFips/khatt-trocr-finetuned" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FixFips/khatt-trocr-finetuned", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/FixFips/khatt-trocr-finetuned
- SGLang
How to use FixFips/khatt-trocr-finetuned 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 "FixFips/khatt-trocr-finetuned" \ --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": "FixFips/khatt-trocr-finetuned", "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 "FixFips/khatt-trocr-finetuned" \ --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": "FixFips/khatt-trocr-finetuned", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use FixFips/khatt-trocr-finetuned with Docker Model Runner:
docker model run hf.co/FixFips/khatt-trocr-finetuned
| { | |
| "architectures": [ | |
| "VisionEncoderDecoderModel" | |
| ], | |
| "decoder": { | |
| "activation_dropout": 0.0, | |
| "activation_function": "relu", | |
| "add_cross_attention": true, | |
| "attention_dropout": 0.0, | |
| "classifier_dropout": 0.0, | |
| "cross_attention_hidden_size": 384, | |
| "d_model": 256, | |
| "decoder_attention_heads": 8, | |
| "decoder_ffn_dim": 1024, | |
| "decoder_layerdrop": 0.0, | |
| "decoder_layers": 6, | |
| "dropout": 0.1, | |
| "init_std": 0.02, | |
| "is_decoder": true, | |
| "layernorm_embedding": true, | |
| "max_position_embeddings": 512, | |
| "model_type": "trocr", | |
| "scale_embedding": true, | |
| "tie_word_embeddings": false, | |
| "torch_dtype": "float32", | |
| "use_cache": false, | |
| "use_learned_position_embeddings": true, | |
| "vocab_size": 64000 | |
| }, | |
| "decoder_start_token_id": 33, | |
| "encoder": { | |
| "attention_probs_dropout_prob": 0.0, | |
| "encoder_stride": 16, | |
| "hidden_act": "gelu", | |
| "hidden_dropout_prob": 0.0, | |
| "hidden_size": 384, | |
| "image_size": 384, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 1536, | |
| "layer_norm_eps": 1e-12, | |
| "model_type": "deit", | |
| "num_attention_heads": 6, | |
| "num_channels": 3, | |
| "num_hidden_layers": 12, | |
| "patch_size": 16, | |
| "pooler_act": "tanh", | |
| "pooler_output_size": 384, | |
| "qkv_bias": true, | |
| "torch_dtype": "float32" | |
| }, | |
| "eos_token_id": 34, | |
| "is_encoder_decoder": true, | |
| "max_length": null, | |
| "model_type": "vision-encoder-decoder", | |
| "num_beams": null, | |
| "pad_token_id": 31, | |
| "tie_word_embeddings": false, | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.51.3", | |
| "vocab_size": 64000 | |
| } | |